shallow-compare-without-functions

0.0.2 • Public • Published

shallow-compare-without-functions

Travis

Just like React addons shallowCompare except it ignores functions. It's not uncommon to want to bind to a instance function or wrap and action creator. The problem with doing this is that even if the value props don't change, using a new function will trigger a re-render, making it a bad idea to use shallowCompare in that case. Additionally, the actual behavior of those functions almost never changes.

See this demo for an example.

Package Sidebar

Install

npm i shallow-compare-without-functions

Weekly Downloads

24

Version

0.0.2

License

MIT

Last publish

Collaborators

  • garbles