{"bugs":{"url":"https://github.com/Monar/react-immutable-pure-component/issues"},"dist":{"shasum":"2e87a52b0289c709dff8993115fdbbbde728d455","tarball":"https://registry.npmjs.org/react-immutable-pure-component/-/react-immutable-pure-component-2.2.0-rc.2.tgz","fileCount":8,"integrity":"sha512-CgVozUIQCaR6lw6Qzn9uzg/iq2EvAx2TsSsecsw1RhkdlucubA8b8iZvAWspdwuB6IxaVePRCNmZTtTd9h3qzg==","signatures":[{"sig":"MEQCIB3yXqV2oUo8su8Tgiy3tYTJ2/3UZO/KwTmci+Eb+D1NAiBY7lR8sfM1GcT2CeYfQe4eyw9+vil96KXxjansBiyiEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUuYDCRA9TVsSAnZWagAAApEP/R2vTFT9j8kIh63tGMi4\nMyJEK0NjTajhwQElfTX2SOcjubj/PQHhc4b/0QQpRlAix9hRbDHIIlK3zGBY\nTnYP4Y6ZXhhx2EocxrvbxSwXVY+KBhQILrY91CDxqzEhYkk7N7X/Hg8gGjp5\nhiEQMj48Nljfd9oKA0TeEIZTrNlPqyBnx1ighL34iXY8hlMQ2Woko+ivo9k0\nzBlpIu2eUEJHj9x95le97GsiJFh69NNSeAgZtzh1WED3z42yvjEShH/7SU6s\nw/frnM+aZeozbW4bYkDIEi2B2yoTWUK4ze0/t70a4mB6aSgh3yFcu1AS4T+Q\nKNar+ak5yWZ8Vk98MR6ZY+59IBHQyr0PHkJcLChwnxYmhKXf52+MUhbWDuqn\n8RLtFqNz/3MDUn2ulD1N1O//nhlItoJpM5vQV2xUymsABxLp2CEaq4PFrhvs\nWRFbOHuV8WDNR+ZvOv5DIshdHnpHTzKqJnewRwgbzpUGH11dQdWjX0HGS70J\nJZr09YR2BXrt2kjUqRtnjlNmlg6QYTHma3AFP7mLKFNSZhKx/kqfLgpsF3WN\nZfeKhlJO0jKvw83LPrRqpkOQN2GBU7PWSLpUu+EeFN/NImBF8BaqXTCrdCoU\n18x7hDwW1m29Cz+CTXtk2Psl/erjAQMjgXjV6I7R5D0w02jDKX3fyjUvY5/n\nOL2e\r\n=pZuA\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":"eab03677f3ea31c8251e7b707d03fc1146f49475","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.2.0","description":"React PureComponent implementation embracing Immutable.js","directories":{},"maintainers":[{"name":"mastermonar","email":"dev@monarski.pl"}],"_nodeVersion":"10.9.0","dependencies":{"@types/react":"*"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"23.6.0","react":"16.7.0","enzyme":"3.8.0","eslint":"5.12.0","rollup":"1.1.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","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.7.0","rollup-plugin-babel":"4.3.0","eslint-plugin-import":"2.14.0","eslint-config-prettier":"3.5.0","eslint-plugin-flowtype":"3.2.1","eslint-plugin-prettier":"3.0.1","enzyme-adapter-react-16":"1.7.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.2_1548936707096_0.6940735104360505","host":"s3://npm-registry-packages"},"_id":"react-immutable-pure-component@2.2.0-rc.2","version":"2.2.0-rc.2"}