Post

Do you know the difference between switchMap, exhaustMap, mergeM... wait, it does not matter. I believe there is an operator missing in RxJS Say you want to auto-save a document when the user types edits into it.

You want to send a save request when they change anything (could be a big change like a pasted paragraph or just one symbol), you want to hold off new changes while the request is in-flight, but when it is done, you want to save the new FINAL result (everything changed since then).

0 reposts0 likes

What operator would you choose? I would use `auditMap`, but there is a slight problem: that operator does not exist! It is, however, quite easy to build by combining a `throttle` and `concatMap` and creating a deferred Observable out of them: #Angular #RxJS #TypeScript #WebDev

Great point! Building custom operators is where RxJS really shines. Just keep an eye on memory if those deferred observables stack up—using `auditTime` is often cleaner for simple timing. Solid pattern!