createToken · Core API
function createToken<T>(name): Token<T>;Creates a unique typed token.
The name is used only for diagnostics. Token identity is unique per call,
so two tokens with the same name do not collide.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
Human-readable name used in diagnostics. |
Returns
Section titled “Returns”Token<T>
A unique token carrying the type parameter T.
Example
Section titled “Example”const CONFIG = createToken<Config>("config");