Why do you think that nesting subscriptions is a bad practice?
How to do it better? ๐ก
See second picture :)
Why do you think that nesting subscriptions is a bad practice?
How to do it better? ๐ก
See second picture :)
โ ๏ธ #Angular / RxJs bad practice alert: nesting subscriptions
Nesting subscriptions is considered a bad practice due to:
- decreased readability
- the need to handle each subscription one by one
- breaks reactive flow
@angular.dev.web.brid.gy 19 is around the corner ๐
Lots of SSR improvements and new signal-utilities are coming: linkedSignal, resource and rxResource
Hi, nice idea. Please add me :)
The last 2 sentences describe the behaviour of unicast.
Btw. Now it should also be obvious why you see multiple network requests when you are certainly sure that you only trigger a http-request once ๐
I can be something like of(1) or even a http-request.
Whenever someone subscribes the producer function is executed. This happens for every subscriber.
unicasted observable
What the heck does unicast mean in terms of #RxJs observable?
Observables are sources of values/events. They somehow need to produce them.
Producing a value means executing a so called producer function. A producer function is all that describes creating the value this particular source can emit.
scan-operator redux code example
I want to present a more sophisticated example on how to create a mini-redux / #ngrx powered by scan.
Please note that it is very very simplified just to point out how powerful scan is.
Link to stackblitz in first comment ๐
@angular.dev.web.brid.gy