|
|
|
@ -27,6 +27,12 @@ export class GlobalRegistry {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Initialize the global registry in the current sync context. */
|
|
|
|
|
public enter(): this {
|
|
|
|
|
this.storage.enterWith(new Collection<GlobalRegistrant>())
|
|
|
|
|
return this
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Store the given `value` associated by `key`.
|
|
|
|
|
* @param key
|
|
|
|
@ -55,7 +61,7 @@ export class GlobalRegistry {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Get the globals collection or throw an error if outside async context. */
|
|
|
|
|
protected getCollection(): Collection<GlobalRegistrant> {
|
|
|
|
|
public getCollection(): Collection<GlobalRegistrant> {
|
|
|
|
|
const coll = this.storage.getStore()
|
|
|
|
|
if ( !coll ) {
|
|
|
|
|
throw new AccessGlobalRegistryOutsideAsyncLifecycleError()
|
|
|
|
|