Last active
April 3, 2019 06:16
-
-
Save AriPal/f0ec1a8e3146a5d89270c70d3e16e0f5 to your computer and use it in GitHub Desktop.
This file contains 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
// Get configs from server | HTTP GET | |
getConfigs(): Observable<Config[]> { | |
// Cache it once if configs value is false | |
if (!this.configs) { | |
this.configs = Observable$.pipe( | |
// ... operators | |
publishReplay(1), | |
refCount() | |
); | |
} | |
return this.configs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment