From 3e3e46ee2405af391384d29f0c3536863cd314a6 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Mon, 20 Jul 2020 16:22:49 -0700 Subject: [PATCH] 0.3.1 a new combination is also ready type observer (combination of combination). Set that. --- package.json | 2 +- src/ready.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 }