rodux
rodux copied to clipboard
Move Heartbeat changed listening to Roact
Right now, Store.changed
only fires once per Heartbeat (or other event, I don't remember) in order to reduce the number of renders resulting from Rodux changes.
When using Rodux standalone, that doesn't make any sense -- your UI framework should be doing the change batching.
I want to implement this render batching in Roact and then remove it from Rodux.
After lots of meetings about Roact and Rodux performance, I'm less certain about this!
Roact definitely should be deduplicating changes that come from Rodux, but I'm unsure about removing the feature from Rodux still. There are definitely some cases where Rodux not firing changed
synchronously can cause weird delays!
I think there's some arguments in favor of firing Store.changed
on a regular basis. There are some Redux libraries that aim to reduce the amount of subscriber invocations or batch actions together:
These are all centered around the same core idea: reducing the number of subscriber invocations. I think this is a pretty reasonable feature to build into Rodux by default, for performance reasons if nothing else.
Just want to let you know, there were times in which I considered using Rodux in non-Roact contexts, but decided against it for this very reason. I would re-consider moving this behavior to Roact at the very least, as this is not how regular Redux behaves.