[RxJS] mergeMap, concatMap, exhaustMap: execute order

mergeMap: order is not ensure

Depends on each request, the response order might not be the same as request.

 

concatMap: order is ensured

concatMap ensure the order is preserved

exhaustMap: ensure only first inner observable complete then trigger latest outer observable.

Which means, some outer observable will be ignored.

Use case: for delete operation, exhaustMap ensure only first click event request sent to server, ignore double click delete button cases.

source: https://www.youtube.com/watch?v=yjZM0LbVf7Q

posted @ 2022-06-21 12:47  Zhentiw  阅读(23)  评论(0编辑  收藏  举报