4 ms·
After over two years heavily using RxJS in Angular for all kids of stuff (I once mapped a 100+ step-long Excel formula with success), the only advice I can give
by polyterative 8y ago
After over two years heavily using RxJS in Angular for all kids of stuff (I once mapped a 100+ step-long Excel formula with success), the only advice I can give is to make a single pipe for a single purpose, using map() and friends to run data down the pipe and performing the decisive final action in the subscribe, possibily a one-line action.
Doing this reduces risk of side effects and help reading the code/debugging.
Also you must take in account stuff like back-pressure and multicasting observables, which are as useful as hard to master and maintain correctly.
Really once you stop putting subscriptions in subscriptions by using the switchMap or switchMapTo operators, a lot of errors start to become clear and avoided.