X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d0611f387f0ec0163fc8f6053a7715bc3d592700..5bfb2e1cb9f87c2e62aaae870a8789ed132eba50:/src/common/service-provider.ts diff --git a/src/common/service-provider.ts b/src/common/service-provider.ts index 080916c55c..e0504ebf8c 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();