Skip to content

Commit

Permalink
fix(lolapi): request are not cached
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Jan 2, 2017
1 parent b746e44 commit f7b0971
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/services/lolapi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export class LolApiService {

private cache(url: string): Observable<any> {
if (!this.cachedObservables[url]) {
this.cachedObservables[url] = Observable.defer(() => this.http.get(url)).publish().refCount();
this.cachedObservables[url] =
Observable.defer(() => this.http.get(url)).publishReplay().refCount();
}
return this.cachedObservables[url].take(1).map(res => res.json());
}
Expand Down

0 comments on commit f7b0971

Please sign in to comment.