Skip to content

Instantly share code, notes, and snippets.

View feliperohdee's full-sized avatar
🚀
Going High

Felipe Rohde feliperohdee

🚀
Going High
View GitHub Profile
@feliperohdee
feliperohdee / ObservableCache.ts
Created March 15, 2016 16:43
Observable cache
let cache = (source: Observable<any>) => {
let replay: ReplaySubject<any>;
return source
.multicast(() => {
if (!replay) {
replay = new ReplaySubject(2);
setTimeout(() => replay = null, 2500);
}