zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[RxJS] mergeMap, concatMap, exhaustMap: execute order

order Rxjs execute
2023-09-14 08:59:12 时间

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