The rx recommendations say to avoid side effects when possible, and put them in do () (doAction in js) if they are unavoidable.
However, a very common side effect in the user interface is to create some resource (for example, a <div>), which is referred to by the downstream (by child widgets). You must grab pens for these resources so that they can be transferred. For example. if you have an array of data, each of which requires a div, you must create a div for each and pass descriptors for these divs.
However, doAction () discards the return value of the side effect, so you cannot capture the descriptors of the objects being created. You have to do a side effect in select ().
Am I looking at it all wrong? Resources created are states and are secondary. You need state in the stream, but you cannot put it in the stream without sending side effects to select (), which is contraindicated.
source
share