1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 class ServicesProvider {
7 private static instance: ServicesProvider;
12 private constructor() {}
14 public static getInstance(): ServicesProvider {
15 if (!ServicesProvider.instance) {
16 ServicesProvider.instance = new ServicesProvider();
19 return ServicesProvider.instance;
22 public setServices(newServices): void {
24 this.services = newServices;
28 public getServices() {
30 throw "Please check if services have been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal
35 public setStore(newStore): void {
37 this.store = newStore;
43 throw "Please check if store has been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal
50 export default ServicesProvider.getInstance();