Skip to content

Instantly share code, notes, and snippets.

@AriPal
Last active April 3, 2019 06:16
Show Gist options
  • Save AriPal/f0ec1a8e3146a5d89270c70d3e16e0f5 to your computer and use it in GitHub Desktop.
Save AriPal/f0ec1a8e3146a5d89270c70d3e16e0f5 to your computer and use it in GitHub Desktop.
// 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