{"_id":"shallow-compare","_rev":"291938","name":"shallow-compare","description":"Stand alone shallowCompare for use in libraries that support shouldComponentUpdate","dist-tags":{"latest":"1.2.2"},"maintainers":[{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"time":{"modified":"2021-06-03T18:52:14.000Z","created":"2016-10-27T15:31:18.115Z","1.2.2":"2017-09-28T19:42:08.256Z","1.2.1":"2017-03-20T19:38:01.200Z","1.2.0":"2016-10-27T15:31:18.115Z"},"users":{"jacob-beltran":true},"author":"","repository":{"type":"git","url":"git+https://github.com/tkh44/shallow-compare.git"},"versions":{"1.2.2":{"name":"shallow-compare","version":"1.2.2","description":"Stand alone shallowCompare for use in libraries that support shouldComponentUpdate","main":"lib/index.js","module":"es/index.js","files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component","clean":"nwb clean-module && npm clean-demo","start":"nwb serve-react-demo","test":"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server"},"dependencies":{},"devDependencies":{"nwb":"0.15.x","preact":"^7.2.0","react":"^15.4.2","react-dom":"^15.4.2"},"author":"","homepage":"https://github.com/tkh44/shallow-compare#readme","license":"MIT","repository":{"type":"git","url":"git+https://github.com/tkh44/shallow-compare.git"},"keywords":["react-component"],"gitHead":"57a0e7afd38e1de375c5f051f6d59ae0d54e2f3f","bugs":{"url":"https://github.com/tkh44/shallow-compare/issues"},"_id":"shallow-compare@1.2.2","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"tkh44","email":"kye.hohenberger@gmail.com"},"dist":{"shasum":"fa4794627bf455a47c4f56881d8a6132d581ffdb","size":4791,"noattachment":false,"key":"/shallow-compare/-/shallow-compare-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/shallow-compare/download/shallow-compare-1.2.2.tgz"},"maintainers":[{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shallow-compare-1.2.2.tgz_1506627727324_0.4244085580576211"},"directories":{},"publish_time":1506627728256,"_hasShrinkwrap":false,"_cnpm_publish_time":1506627728256},"1.2.1":{"name":"shallow-compare","version":"1.2.1","description":"Stand alone shallowCompare for use in libraries that support shouldComponentUpdate","main":"lib/index.js","module":"es/index.js","files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component","clean":"nwb clean-module && npm clean-demo","start":"nwb serve-react-demo","test":"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server"},"dependencies":{},"peerDependencies":{"react":"15.x"},"devDependencies":{"nwb":"0.15.x","preact":"^7.2.0","react":"^15.4.2","react-dom":"^15.4.2"},"author":"","homepage":"","license":"MIT","repository":"","keywords":["react-component"],"gitHead":"cfcd09026167806a68b0eefdc4b373bf291d2bb4","_id":"shallow-compare@1.2.1","_shasum":"6a42931a81f8ab52bfad229c14f1635e5488ba7a","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.6.0","_npmUser":{"name":"tkh44","email":"kye.hohenberger@gmail.com"},"dist":{"shasum":"6a42931a81f8ab52bfad229c14f1635e5488ba7a","size":4786,"noattachment":false,"key":"/shallow-compare/-/shallow-compare-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/shallow-compare/download/shallow-compare-1.2.1.tgz"},"maintainers":[{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/shallow-compare-1.2.1.tgz_1490038680543_0.08805627143010497"},"directories":{},"publish_time":1490038681200,"_cnpm_publish_time":1490038681200,"_hasShrinkwrap":false},"1.2.0":{"name":"shallow-compare","amdName":"shallowCompare","version":"1.2.0","description":"Stand alone shallowCompare for use in libraries that support shouldComponentUpdate","main":"dist/shallow-compare.js","minified:main":"dist/shallow-compare.min.js","jsnext:main":"src/index.js","files":["src","test","dist"],"scripts":{"build":"npm-run-all transpile optimize minify","transpile":"rollup -c rollup.config.js -m ${npm_package_main}.map -f umd -n $npm_package_amdName $npm_package_jsnext_main -o $npm_package_main","optimize":"uglifyjs $npm_package_main -bc -o $npm_package_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_main}.map","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","test":"standard && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm run build","release":"npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015-minimal","stage-0"]},"devDependencies":{"babel":"^6.5.2","babel-eslint":"^6.0.2","babel-plugin-transform-class-properties":"^6.6.0","babel-plugin-transform-react-jsx":"^6.7.5","babel-preset-es2015":"^6.6.0","babel-preset-es2015-minimal":"^1.1.0","babel-preset-es2015-minimal-rollup":"^2.0.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint-plugin-react":"^4.3.0","expect":"^1.20.2","mocha":"^2.4.5","npm-run-all":"^1.7.0","preact":"*","rollup":"^0.25.8","rollup-plugin-babel":"^2.4.0","standard":"^8.4.0","uglify-js":"^2.6.2","undom":"^0.3.0"},"author":{"name":"Kye Hohenberger"},"homepage":"https://github.com/tkh44/shallow-compare","license":"MIT","repository":{"type":"git","url":"git+https://github.com/tkh44/shallow-compare.git"},"keywords":["preact","preact-compat","react","react-shallow-compare","shallow-compare","shallow","shallowCompare","preact shallowCompare"],"standard":{"ignore":["/dist/"]},"gitHead":"4cf40c158a62e56eee2dc3e4460bbda6fa97d2e3","bugs":{"url":"https://github.com/tkh44/shallow-compare/issues"},"_id":"shallow-compare@1.2.0","_shasum":"b58dbb0ef5c21814946354760bf06e5aac085055","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"tkh44","email":"kye.hohenberger@gmail.com"},"dist":{"shasum":"b58dbb0ef5c21814946354760bf06e5aac085055","size":3499,"noattachment":false,"key":"/shallow-compare/-/shallow-compare-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/shallow-compare/download/shallow-compare-1.2.0.tgz"},"maintainers":[{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/shallow-compare-1.2.0.tgz_1477582276300_0.31008615670725703"},"directories":{},"publish_time":1477582278115,"_cnpm_publish_time":1477582278115,"_hasShrinkwrap":false}},"readme":"# shallow-compare\n\n[![npm version](https://badge.fury.io/js/shallow-compare.svg)](https://badge.fury.io/js/shallow-compare)\n\nStand alone shallowCompare for use in libraries that support shouldComponentUpdate\n\n## API\n\n`shallowCompare(instance, nextProps, nextState)`\n\n - instance (_component instance_) - the component's instance (`this`)\n - nextProps (_object_) - the next props\n - nextState (_object_) - the next state\n \n## Example\n```javascript\nclass Foo extends Component {\n  constructor (props) {\n    super(props);\n    this.state = { color: 'blue' }\n  }\n\n  shouldComponentUpdate (nextProps, nextState) {\n    return shallowCompare(this, nextProps, nextState)\n  }\n\n  render () {\n    return (\n      <div>{this.state.color}</div>\n    )\n  }\n}\n```\n","_attachments":{},"homepage":"https://github.com/tkh44/shallow-compare#readme","bugs":{"url":"https://github.com/tkh44/shallow-compare/issues"},"license":"MIT"}