Created
May 23, 2017 20:00
-
-
Save marcusradell/e6a6fc67178e9cf05bc774f1a59a8b92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const categoryFiltersStateStream = viewDataStream.switchMap( | |
checkboxesComponent => { | |
sub = checkboxesComponent.checkboxesStateStream.subscribe( | |
state => console.log("INNER EMIT 2", state, sub), | |
error => console.error("INNER ERROR 2", error), | |
// but also closes before first emit | |
() => console.log("INNER COMPLETE 2", sub) | |
); | |
return checkboxesComponent.checkboxesStateStream; | |
} | |
); | |
// this only emits once | |
categoryFiltersStateStream.subscribe( | |
state => console.log("EMIT ", state), | |
error => console.error("ERROR", error), | |
() => console.log("COMPLETE") | |
); | |
/* produces | |
INNER COMPLETE 2 Subscriber {closed: true, _parent: null, _parents: null, _subscriptions: null, syncErrorValue: null…}closed: truedestination: SafeSubscriberisStopped: truesyncErrorThrowable: falsesyncErrorThrown: falsesyncErrorValue: null_parent: null_parents: null_subscriptions: null__proto__: Subscription | |
INNER EMIT 2 (3) [Object, Object, Object] Subscriber {closed: true, _parent: null, _parents: null, _subscriptions: null, syncErrorValue: null…} | |
EMIT (3) [Object, Object, Object] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment