X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4b956bd2e3bcccdeb808df7391d135659cf85b94..28a7883c373533979f2cc7c5e750221eb8f5f1ec:/src/common/service-provider.ts diff --git a/src/common/service-provider.ts b/src/common/service-provider.ts index 1362de9a..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() {} @@ -26,10 +27,24 @@ class ServicesProvider { public getServices() { if (!this.services) { - throw "Please check if services have been set in the index.ts before the app is initiated"; + throw "Please check if services have been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal } 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();