1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 class ServicesProvider {
7 private static instance: ServicesProvider;
11 private constructor() {}
13 public static getInstance(): ServicesProvider {
14 if (!ServicesProvider.instance) {
15 ServicesProvider.instance = new ServicesProvider();
18 return ServicesProvider.instance;
21 public setServices(newServices): void {
23 this.services = newServices;
27 public getServices() {
29 throw "Please check if services have been set in the index.ts before the app is initiated"; // eslint-disable-line no-throw-literal
35 export default ServicesProvider.getInstance();