I have the following theoretical problem to solve and please note that there might be a more general solution to the example issue I describe, but I specifically want to know on how to create a joined observable with these properties.
I have an observable of change events that should trigger save actions (which result in a observable of the save success).
- I need to make sure that in the end the very last save event will definitely be executed.
- Saving itself is a complex process and takes some time and during a save event no additional save actions should be executed.
Using exhaust or exhaustMap almost does, what I want: It assures that while saving is in progress no other event is fired. While concat or concatMap would ensure that the last one will be carried out, but I will do a lot of unnecessary save actions.
To rephrase it: How to create an observable that will exhaust and concat the last event?