@epikodelabs/streamix / src/public-api / Token
Type Alias: Token<T>
Token<
T> =symbol&object
Defined in: projects/libraries/streamix/src/lib/ioc/token.ts:14
A typed injection token.
Tokens are opaque symbols with a phantom type parameter. They are used as keys for dependency registration and resolution.
Type Declaration
__type
readonly__type:T
Type Parameters
T
T
Example
ts
const HttpClient = createToken<HttpClient>("HttpClient");
container.register(HttpClient, () => new FetchHttpClient());
const http = container.resolve(HttpClient);