0.3.1 a new combination is also ready type observer (combination of combination). Set that.
parent
7730a94d3d
commit
3e3e46ee24
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@uci-utils/ready",
|
"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",
|
"description": "A Class to Observe the reduced to boolean combined state of a map of observables",
|
||||||
"main": "src/ready.js",
|
"main": "src/ready.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -137,7 +137,7 @@ class Ready extends Map {
|
||||||
|
|
||||||
// TODO have combineObservers call this
|
// TODO have combineObservers call this
|
||||||
makeCombination(observers,list){
|
makeCombination(observers,list){
|
||||||
observers = observers.filter(obs=>obs._readyType)
|
observers = observers.filter(obs=>(obs || {})._readyType)
|
||||||
if (!observers.length) return false
|
if (!observers.length) return false
|
||||||
let combination = combineLatest(observers).pipe(
|
let combination = combineLatest(observers).pipe(
|
||||||
tap(states => { if (list) this.log(list.map((name,index) => [name,states[index]]))}),
|
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
|
changed(), //filters out emission if it is unchanged from last TODO replace with distinctUntilChanged
|
||||||
shareReplay(1)
|
shareReplay(1)
|
||||||
)
|
)
|
||||||
|
combination._readyType = true
|
||||||
return combination
|
return combination
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue