diff --git a/package.json b/package.json index 39364e6..1d3e8ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uci-utils/ready", - "version": "0.3.0", + "version": "0.3.1", "description": "A Class to Observe the reduced to boolean combined state of a map of observables", "main": "src/ready.js", "scripts": { diff --git a/src/ready.js b/src/ready.js index 92ba344..14447ae 100644 --- a/src/ready.js +++ b/src/ready.js @@ -137,7 +137,7 @@ class Ready extends Map { // TODO have combineObservers call this makeCombination(observers,list){ - observers = observers.filter(obs=>obs._readyType) + observers = observers.filter(obs=>(obs || {})._readyType) if (!observers.length) return false let combination = combineLatest(observers).pipe( tap(states => { if (list) this.log(list.map((name,index) => [name,states[index]]))}), @@ -145,6 +145,7 @@ class Ready extends Map { changed(), //filters out emission if it is unchanged from last TODO replace with distinctUntilChanged shareReplay(1) ) + combination._readyType = true return combination }