{"bugs":{"url":"https://github.com/Monar/react-immutable-pure-component/issues"},"dist":{"shasum":"d0ae23f95c02f289ce8d2bfc64064c3180d90b78","tarball":"https://registry.npmjs.org/react-immutable-pure-component/-/react-immutable-pure-component-2.0.1.tgz","fileCount":6,"integrity":"sha512-R/6abB0/UAkMBXQtz0n1mm7uL0vw/fNvG1Q/ZHSPZg5SrR06DSZmOflTBUdHNClShG1k8b2UK1hfMTknJXYmPw==","signatures":[{"sig":"MEYCIQDV1/rGBSWqQeKc/iEY3nwE388pmX94HIArMmerReHR9QIhAK6oquXAp2pBGaGOgr5mPcEcyDMWD2L7ODHNLElTTM4E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKjuwCRA9TVsSAnZWagAAgoAQAIWkLMDFm6Vz5GaZSHZ2\nfWxDuLc5zS7LSNrYsmA4XXY7kAvFtsoXpub+4dry2NJ5W5ELwWWd/qbGSgcI\nfW1D+KjPTgao9c2t2ItvrHxNFhcZsm4+ebkT0S7w2SGBlij7IN537HCqVtUU\nCHY5CWGV/nOvqjlw3uq287IGzXoUQvUsJma5IpZYJ7bz3+jJogDOEmCvH9JV\n+kgLU1Muv7HMheg7Thu2LyCjhRblhgs6lw7D8OJxBI7vetBuVjLQAqv66Jwe\nUhGoQkdQUTcECXBfQ5od0Lf8LRC1oT4VJ2TNbGfhTvAVJAF8RwDHJJ0rdDB/\nX3hnCLEC3dXtsxXmud4knp448iuwkQo3YsH/dxgNle9Bnsw0E85dK2g9fJiI\noG5Hyx9urVT4emWNmMYw7EdGE9P0VRqzxEyUiFYf1fEPGCRySadqOAmrVKT7\nddyaQE2LzPv5+Nb9W2FXvlYYqZo62U2HbxhRHEBYe8v4kM3jiihZT8bJHmLN\ncQphwSoMgIOs158EWlyBFDXqJv9otfqL5nqarYumpo8ZDOIozPgRgSNtUoeG\n/6niUYGLlJBevgsjwIJs1OrmsWztlsxn/S21j+XUvuYldszHS016Y4Bm7/zt\nFA4UaMAvYfBbRGxA0mzjykwp5fcC8yfSEkheOaWIIaQ4gnd5qlfqFbxMKK2W\nhKiW\r\n=s/zO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/react-immutable-pure-component.cjs.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.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 array of keys like in the example below. Checking values under path is\nworking for `Immutable` data structures as well as for plain js data\nstructures.\n\nUnder the hood version 2 is using\n[getIn](https://facebook.github.io/immutable-js/docs/#/getIn) which is new\naddition to `Immutable@4` so if you operate on previews versions use\n`react-immutable-pure-component@1` which is missing option to pass a path to\n`updateOnProps` and `updateOnStates`.\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":"5f283abb5d718fe23c53c24bed4dc0f7e16f4610","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","immutable","pure","component","PureComponent"],"repository":{"url":"git+https://github.com/Monar/react-immutable-pure-component.git","type":"git"},"_npmVersion":"6.4.1","description":"React PureComponent implementation embracing Immutable.js","directories":{},"maintainers":[{"name":"mastermonar","email":"dev@monarski.pl"}],"_nodeVersion":"11.1.0","dependencies":{"@types/react":"*"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"23.6.0","react":"16.7.0","eslint":"5.11.1","rollup":"1.0.0","prettier":"1.15.3","immutable":"4.0.0-rc.12","react-dom":"16.7.0","babel-core":"7.0.0-bridge.0","babel-jest":"23.6.0","@babel/core":"7.2.2","babel-eslint":"10.0.1","publish-please":"5.4.3","@babel/preset-env":"7.2.3","eslint-config-monar":"1.0.2","eslint-plugin-babel":"5.3.0","eslint-plugin-react":"7.12.0","react-test-renderer":"16.7.0","rollup-plugin-babel":"4.2.0","eslint-plugin-import":"2.14.0","eslint-config-prettier":"3.3.0","eslint-plugin-prettier":"3.0.1","@babel/plugin-transform-object-assign":"7.2.0"},"peerDependencies":{"react":">= 15","immutable":">= 4 || >= 4.0.0-rc","react-dom":">= 15"},"optionalDependencies":{"@types/react":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-immutable-pure-component_2.0.1_1546271663320_0.06677889389173064","host":"s3://npm-registry-packages"},"_id":"react-immutable-pure-component@2.0.1","version":"2.0.1"}