X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a5f5a2ec8ae05ec2ad41dda0cd736dafe6cc669d..39c55ead904f943894f1658b9efa4a7c77584382:/src/common/service-provider.ts diff --git a/src/common/service-provider.ts b/src/common/service-provider.ts index 080916c5..e0504ebf 100644 --- a/src/common/service-provider.ts +++ b/src/common/service-provider.ts @@ -6,6 +6,7 @@ class ServicesProvider { private static instance: ServicesProvider; + private store; private services; private constructor() {} @@ -30,6 +31,20 @@ class ServicesProvider { } return this.services; } + + public setStore(newStore): void { + if (!this.store) { + this.store = newStore; + } + } + + public getStore() { + if (!this.store) { + throw "Please check if store has been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal + } + + return this.store; + } } export default ServicesProvider.getInstance();