rickyvetter / reductive

Redux in Reason
MIT License
408 stars 40 forks source link

Reductive doesn't avoid supurious rerenders #27

Open conartist6 opened 6 years ago

conartist6 commented 6 years ago

See: https://github.com/reasonml-community/reductive/blob/master/src/reductive.re#L64

The way createMake is written Reductive would never be able to perform the function of avoiding rerenders because there's only one action type and individual action types need to explicitly pattern match to whether or not an update should be done when in use by a reducer component.

React/Redux patterned applications shouldn't see responsiveness degrade continually as app size increases, and as far as I can tell currently they will, without explicit user intervention in the form of hand written shouldComponentUpdates.

nlfiedler commented 6 years ago

I've tried to address this in pull request #35, and I covet your feedback. It's a proof of concept, not necessarily the best way to implement it. I tried to make the lens optional, but I couldn't manage to equate 'state to 'lensed if the argument was not provided. Likewise, I couldn't fashion an "identity" lens in a way that made the compiler happy. I only started learning ReasonML two weeks ago.

nlfiedler commented 5 years ago

I think this is fixed now.