aweary / react-copy-write

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

Add consume prop, rename selectors to select #34

Closed aweary closed 6 years ago

aweary commented 6 years ago

consume is a better API than memoize because it can prevent re-renders from unrelated state updates and unrelated prop updates. It lets the Consumer say "here are some values that I consume"

I also renamed selectors to select so that it's language consistent (consume this, select this)

shengmin commented 6 years ago

yeah, i don't know if what this props does is memoize, and it's more like reRenderIfChanged or reactiveProps

aweary commented 6 years ago

OK, another breaking change, here we go!