{"bugs":{"url":"https://github.com/Monar/react-immutable-pure-component/issues"},"dist":{"shasum":"09d1bd8ede09a25d9ec12a9d94df5130938e5c38","tarball":"https://registry.npmjs.org/react-immutable-pure-component/-/react-immutable-pure-component-2.2.0-rc.4.tgz","fileCount":8,"integrity":"sha512-u0V0gIrsjSZ+xhMtAaZyjWzVClJbfg6nvOOJzKkgypXgTew9JAzlsXVx11i6GKmjxMHUVwSYDx6iZs2G2tlezg==","signatures":[{"sig":"MEUCIA2dD1Jzzjd+5320APq4Y/EinoxnvQ1M0mdvdmzPiXzkAiEAlpKEKjdgYh3MdG42FIPxVEcOy5njaE3q7v7xJQaiXWQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcax75CRA9TVsSAnZWagAAvpYP/j0D5B3DaXp5yF+vUhIc\nBy3GatLqrvzJ31ZAWnUuSpcaAikvtr02wbnRT1IdTY1TTyWgwt3z2Df7wsoe\n6I6mCZg87ICnUBOK3BNd7/O2arPtY1dBFpDDtvm5QNN6iBD5/9USrbJprTOd\neMtrO2FHQuxbOhY8wUzScUN1DiMmGcjLXLQJwViVfTKy3w4dOnR76PCRoEPh\n9VgEsThiTXU02aGR3U4yQOVCjC0HkVp4NI8VUf4FzmQW8m2HMiWxe7edT/hd\nfla2oy7Dj336eL6QooWEreBTVayRibctsMWqWtlDds9LvExF5XrO5xss5ngb\nVe6OStntBabOknvmqhXdu0s0TsgRQXQQPw6wgCMBAMZaYOkvvkPHPWPFln9g\nUbl+pG8JENEphaBZSFMsogQYailIjIWD/aFbm85Vqe1taLf6sayI8mvguo4J\n6iSKzMYQk3FzaS/ygtnjwsIv4l6ZT03MMo8Q1Bqdv2dH2v/wlPlNwK04O0tM\nTmjZC/btEPWGuFxjcM6qT7SsDXHhcn3Rjy6F6oUKoVIHO9694hnMHJ212zj1\nvh4MGrvyoZ+uw8aDQAuE1jvcL60jlM/7+vksOoLrjCCghkCv/4PQaSFRbGCN\nDgeymfumu9I5+X7dxf+Whhim0Fi8Z4wrZnOrmmm5BRG3fNXz2ZBt6JsgQPms\nRx9U\r\n=L+cJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/react-immutable-pure-component.js","name":"react-immutable-pure-component","types":"types/react-immutable-pure-component.d.ts","author":{"name":"Piotr Tomasz Monarski"},"module":"lib/react-immutable-pure-component.es.js","readme":"[![npm version](https://badge.fury.io/js/react-immutable-pure-component.svg)](https://badge.fury.io/js/react-immutable-pure-component)\n\n# ImmutablePureComponent\n\nUnfortunately `React.PureComponent` is not embracing `Immutable.js` to it full\npotential. While `Immutable.js` provides [hash value](https://facebook.github.io/immutable-js/docs/#/ValueObject/hashCode),\nwitch allows for fast comparison of two different instances\n`React.PureComonent` is only comparing addresses of those instances.\n\nThe `ImmutablePureComponent` uses\n[is](https://facebook.github.io/immutable-js/docs/#/is) to compare values and\nextends component functionality by introducing:\n* `updateOnProps`\n* `updateOnStates`\n\nWith those properties you can specify list of props or states that will be\nchecked for changes. If value is `undefined` (default) then all `props` and\n`state` will be checked, otherwise array of keys or paths is expected. The path\nis an iterator (eg. Array) of keys like in the example below. Checking values\nunder path is working for `Immutable` data structures as well as for plain js\ndata structures. To benefit from this feature `immutable@4` is required\notherwise non `string` values will throw a `TypeError`.\n\nUnder the hood version 2 is 'optionally' using\n[getIn](https://facebook.github.io/immutable-js/docs/#/getIn) which is new\naddition to `Immutable@4` and all non `string` values are passed as an argument\nto `Immutable.getIn`.\n\n### Example\nIn this example component will update when value of `me` is change and will\nignore changes of `data`, `check` or any other property. Component will also\nupdate on change of first element of `buzz` or change to `type` and will ignore\nchanges to the rest of the state. \n\n```js\nclass Example extends ImmutablePureComponent {\n  state = {\n    fis: { \n      buzz: [10, 11]\n      ignore: 'this',\n    },\n    type: undefined,\n  };\n\n  updateOnStates = [\n    ['fis', 'buzz', 0],\n    'type',\n  ];\n\n  updateOnProps = [\n    ['data', 'check', 'me'],\n  ];\n\n  render() {...}\n}\n\nlet data = Immutable.fromJS({ check: { me: true } })\n\nReactDOM.render(<Example data={data} onChange={() => {}}, root);\n```\n\nTo check what its all about checkout the interactive example :D\n### [Interactive example](https://codesandbox.io/s/github/Monar/react-immutable-pure-component/tree/master/example).\n","gitHead":"054fe99e5cce297c60535f22d521902a032e46af","license":"MIT","scripts":{"lint":"eslint .","test":"jest","build":"rollup -c ./rollup.config.js","lint:fix":"eslint --fix .","testAndBuild":"yarn test; yarn lint; yarn build","prepublishOnly":"publish-please guard","publish-please":"publish-please"},"_npmUser":{"name":"mastermonar","email":"dev@monarski.pl"},"homepage":"https://github.com/Monar/react-immutable-pure-component#readme","keywords":["react","memo","immutable","pure","component","PureComponent"],"repository":{"url":"git+https://github.com/Monar/react-immutable-pure-component.git","type":"git"},"_npmVersion":"6.5.0","description":"React PureComponent implementation embracing Immutable.js","directories":{},"maintainers":[{"name":"mastermonar","email":"dev@monarski.pl"}],"_nodeVersion":"11.9.0","dependencies":{"@types/react":"*"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"24.1.0","react":"16.8.2","enzyme":"3.9.0","eslint":"5.14.0","rollup":"1.2.1","prettier":"1.16.4","immutable":"4.0.0-rc.12","react-dom":"16.8.2","babel-core":"7.0.0-bridge.0","babel-jest":"24.1.0","@babel/core":"7.3.3","babel-eslint":"10.0.1","publish-please":"5.4.3","@babel/preset-env":"7.3.1","rollup-plugin-copy":"0.2.3","@babel/preset-react":"7.0.0","eslint-config-monar":"1.0.2","eslint-plugin-babel":"5.3.0","eslint-plugin-react":"7.12.4","react-test-renderer":"16.8.2","rollup-plugin-babel":"4.3.2","eslint-plugin-import":"2.16.0","eslint-config-prettier":"4.0.0","eslint-plugin-flowtype":"3.4.2","eslint-plugin-prettier":"3.0.1","enzyme-adapter-react-16":"1.9.1","@babel/plugin-transform-object-assign":"7.2.0"},"peerDependencies":{"react":">= 16.6","immutable":">= 2 || >= 4.0.0-rc","react-dom":">= 16.6"},"optionalDependencies":{"@types/react":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-immutable-pure-component_2.2.0-rc.4_1550524152363_0.3199739502275831","host":"s3://npm-registry-packages"},"_id":"react-immutable-pure-component@2.2.0-rc.4","version":"2.2.0-rc.4"}