add ContextToken
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export class ContextToken<T> {
|
||||
/**
|
||||
* @param _desc Description for the token,
|
||||
* used only for debugging purposes,
|
||||
* it should but does not need to be unique
|
||||
*/
|
||||
constructor(protected _desc: string) {}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
get multi(): ContextToken<Array<T>> {
|
||||
return this as ContextToken<Array<T>>;
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return `${ContextToken.name} ${this._desc}`;
|
||||
}
|
||||
}
|
||||
@@ -2,3 +2,4 @@ export * from './consume/context-consumer';
|
||||
export * from './consume/context-request.event';
|
||||
export * from './provide/context-provider';
|
||||
export * from './provide/context-provide.event';
|
||||
export * from './context-token';
|
||||
|
||||
Reference in New Issue
Block a user