diff --git a/src/graph/GraphService.ts b/src/graph/GraphService.ts index 22680ba8..17b35e2d 100644 --- a/src/graph/GraphService.ts +++ b/src/graph/GraphService.ts @@ -13,7 +13,7 @@ export class GraphService { private _updates$: rx.Subject = new rx.Subject(); private _cache$: rx.Subject = new rx.Subject(); - private _cachedNode$: rx.Observable; + private _cachedNode$: rx.ConnectableObservable; private _graph$: rx.Observable; @@ -44,7 +44,8 @@ export class GraphService { return node.key + node.lastCacheEvict; }).flatMap((node: Node): rx.Observable => { return node.cacheAssets(); - }); + }).publish(); + this._cachedNode$.connect(); // make tilesservice aware of that a new node is beeing cached this._cachedNode$.subscribe(this._tilesService.cacheNode$);