Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- There are multiple flattening strategies for observables:
- With mergeMap (which has flatMap as an alias), received observables are subscribed to concurrently and their emitted values are flattened into the output stream.
- With concatMap, received observables are queued and are subscribed to one after the other, as each completes. (concatMap is mergeMap with a concurrency of one.)
- With switchMap, when an observable is received it's subscribed to and any subscription to a previously received observable is unsubscribed.
- With exhaustMap, when an observable is received it's subscribed to unless there is a subscription to a previously received observable and that observable has not yet completed - in which case the received observable is ignored.
- The concatAll, exhaust, mergeAll and switchAll operators for higher-order observables are implemented using the *Map operators.
Add Comment
Please, Sign In to add comment