X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a5f5a2ec8ae05ec2ad41dda0cd736dafe6cc669d..2a2f9c29ef2994b8dd25130715aeb46e66777763:/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();