Delaying until another observable emits
See original GitHub issueI have two observables (of different types), let’s say Observable<Widget>
and Observable<Gadget>
. I’m only ever going to get one Widget, but until I do get that Widget and take appropriate initialization action, I don’t want to receive any Gadgets. Once the Widget has been received, I want all Gadgets to be emitted as fast as possible, and then all subsequent Gadgets to be emitted whenever they arrive.
Is there a tidy way to do this with existing API? The best way I found after a little looking was a Subscriber implementation that would buffer Gadgets in a list until instructed to stop buffering (done via a subscriber on our Widget observable in this example). Upon said state change, the subscriber would emit all buffered objects into another Observer, and simply forward all subsequent objects to the Observable as well. This wasn’t very satisfying, though.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (3 by maintainers)
Doh, sorry for forgetting about this. This also doesn’t seem to demonstrate (or handle) saving events that happen before source1 emits.
Closing due to inactivity. If you have further questions, please reopen this issue or create a new one.