Skip to content

Instantly share code, notes, and snippets.

@owrrpon
Created June 4, 2021 16:18
Show Gist options
  • Save owrrpon/813e6ade573e8fd96daa7cab242fe518 to your computer and use it in GitHub Desktop.
Save owrrpon/813e6ade573e8fd96daa7cab242fe518 to your computer and use it in GitHub Desktop.
managing global state in app-utlity.service.ts
private globals: { [key:string]: any } = {
ongoing_request_count: 0,
loading_animation_control: new Subject<any>()
};
setGlobalData(key: string, value: any){
this.globals[key] = value;
}
getGlobalData(key: string){
return this.globals[key];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment