kentcdodds / use-deep-compare-effect

🐋 It's react's useEffect hook, except using deep comparison on the inputs, not reference equality
https://npm.im/use-deep-compare-effect
MIT License
1.88k stars 84 forks source link

Improve documentation #48

Closed jasperck closed 3 years ago

jasperck commented 3 years ago

What: Nice library! Documenting something I found when playing around with it. use-deep-compare-effect allows us to use object as dependency. Ideally, the effect callback would not be called when none of the properties changed, however, if the object includes function, the effect callback will be called nevertheless

Why: Issue https://github.com/kentcdodds/use-deep-compare-effect/issues/47

Fire a warning might not be an ideal way considering the developer experience. So we decide to update README to make sure people are aware of this scenario.

How: Documenting it by update the README.

Checklist:

kentcdodds commented 3 years ago

@all-contributors please add @jasperck for docs

allcontributors[bot] commented 3 years ago

@kentcdodds

I've put up a pull request to add @jasperck! :tada:

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: