Merge branch '18946-user-profile' refs #18946
[arvados-workbench2.git] / src / common / service-provider.ts
index 1362de9a7680ab82d5bddd473d3c1d3916b930fd..e0504ebf8cc628898da3de5965d25ff26d93801e 100644 (file)
@@ -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();