rodux icon indicating copy to clipboard operation
rodux copied to clipboard

Move Heartbeat changed listening to Roact

Open LPGhatguy opened this issue 6 years ago • 3 comments

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.

LPGhatguy avatar Mar 12 '18 23:03 LPGhatguy

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!

LPGhatguy avatar Mar 23 '18 07:03 LPGhatguy

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.

AmaranthineCodices avatar Mar 24 '18 18:03 AmaranthineCodices

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.

headjoe3 avatar Dec 08 '19 00:12 headjoe3