All files / config configStore.ts

100% Statements 10/10
100% Branches 1/1
100% Functions 6/6
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34    4x 4x         4x 4x   4x       31x       3x       31x       3x         4x  
class ConfigStore {
  private static instance: ConfigStore;
  private rpcUrl: string = "";
  private envMode: string = "";
 
  private constructor() {}
 
  public static getInstance(): ConfigStore {
    if (!ConfigStore.instance) {
      ConfigStore.instance = new ConfigStore();
    }
    return ConfigStore.instance;
  }
 
  setRpcUrl(url: string) {
    this.rpcUrl = url;
  }
 
  getRpcUrl(): string {
    return this.rpcUrl;
  }
 
  setEnvMode(mode: string) {
    this.envMode = mode;
  }
 
  getEnvMode(): string {
    return this.envMode;
  }
}
 
// Export the single instance
export const configStore = ConfigStore.getInstance();