Created
June 4, 2021 16:18
-
-
Save owrrpon/813e6ade573e8fd96daa7cab242fe518 to your computer and use it in GitHub Desktop.
managing global state in app-utlity.service.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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