Fork me on GitHub

@lilactown what if you needed to listen to one more signal to compute <expensive thing>? You'd then need to modify the components controlling the state the signal is derived from to have the same debouncing logic, no? The thing I posted above doesn't have that problem.


Another thing - what if you wanted the computed thing to be able to visualize whether it is up to date or not? (also solved above)


I missed that earlier.


In my specific case, the calculations were happening within the event handler. Ideally they would be done in a subscription, in which case your debounced sub would also work


It also can depend; sometimes you want immediate recalc for certain actions (ex. New data), but for user interaction to debounce because the stream of updates is much faster. Not sure which is better, but that is a very good option if your depending on multiple streams with high throughput


Interesting, hadn't thought of that case. In my case, I think it was similar to one you mentioned - aggregation/filtering/pivoting in response to user interacting with checkboxes, switches, etc


Yeah. I think it's 6 of one, half dozen of the other. Yours is probably more re-frame-esque


Hmm yea, though not sure if mine is re-frame-esque, since I think dispatching from subscriptions is generally frowned on