diff --git a/package.json b/package.json index 05bad85..aac88af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extollo/lib", - "version": "0.13.1", + "version": "0.13.2", "description": "The framework library that lifts up your code.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/util/support/global.ts b/src/util/support/global.ts index 8b91dfb..c0649d5 100644 --- a/src/util/support/global.ts +++ b/src/util/support/global.ts @@ -27,6 +27,12 @@ export class GlobalRegistry { }) } + /** Initialize the global registry in the current sync context. */ + public enter(): this { + this.storage.enterWith(new Collection()) + 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 { + public getCollection(): Collection { const coll = this.storage.getStore() if ( !coll ) { throw new AccessGlobalRegistryOutsideAsyncLifecycleError()