aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

Add memoize prop to Consumer #29

Closed aweary closed 6 years ago

aweary commented 6 years ago

In some cases consumers need to re-render if the props of the component rendering them change. The existing behavior is that consumer callback will only be called if the state they are observing changes.

Adding a memoize prop that users can set to false will provide an escape hatch that lets consumers re-render even if the observed state didn't change.