Skip to content

Javascript utility function for comparing objects only for given keys

License

Notifications You must be signed in to change notification settings

lourd/js-equal-by-keys

Repository files navigation

@lourd/equal-by-keys npm package badge Build status

This single-function JavaScript module is a utility for comparing two objects for a given set of keys. I find it handy when looking for changing props in React component lifecycle methods like componentDidUpdate.

Installation

npm

yarn install @lourd/equal-by-keys

In the browser

Available as a simple <script> through unpkg.com. The function will be available as the global variable equalByKeys.

API

equalByKeys(objA: Object, objB: Object, ...keys: [String])

About

Javascript utility function for comparing objects only for given keys

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published