Skip to content

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 Parameter

T

Parameter Type Description

name

string

Human-readable name used in diagnostics.

Token<T>

A unique token carrying the type parameter T.

const CONFIG = createToken<Config>("config");