{"_id":"@daniakash/useredux","_rev":"2-eb6700a0860fb4756f7708033728ea6e","name":"@daniakash/useredux","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@daniakash/useredux","version":"0.0.1","description":"Hook to connect redux store to react components","author":{"name":"DaniAkash"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DaniAkash/useRedux.git"},"main":"dist/index.js","module":"dist/index.modern.js","source":"src/index.tsx","engines":{"node":">=10"},"scripts":{"build":"microbundle-crl --no-compress --format modern,cjs","start":"microbundle-crl watch --no-compress --format modern,cjs","prepare":"run-s build","test":"run-s test:unit test:lint test:build","test:build":"run-s build","test:lint":"eslint .","test:unit":"cross-env CI=1 react-scripts test --env=jsdom","test:watch":"react-scripts test --env=jsdom","predeploy":"cd example && yarn install && yarn run build","deploy":"gh-pages -d example/build"},"peerDependencies":{"react":"^16.8"},"devDependencies":{"@testing-library/jest-dom":"^4.2.4","@testing-library/react":"^9.5.0","@testing-library/user-event":"^7.2.1","@types/jest":"^25.1.4","@types/node":"^12.12.38","@types/react":"^16.9.27","@types/react-dom":"^16.9.7","@typescript-eslint/eslint-plugin":"^2.26.0","@typescript-eslint/parser":"^2.26.0","babel-eslint":"^10.0.3","cross-env":"^7.0.2","eslint":"^6.8.0","eslint-config-prettier":"^6.7.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.18.2","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.1","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.17.0","eslint-plugin-standard":"^4.0.1","gh-pages":"^2.2.0","microbundle-crl":"^0.13.10","npm-run-all":"^4.1.5","prettier":"^2.0.4","react":"^16.13.1","react-dom":"^16.13.1","react-scripts":"^3.4.1","typescript":"^3.7.5"},"dependencies":{"redux":"^4.0.5"},"gitHead":"f3fee8ff56cf08c44cde1d40672d9a91e7d054ed","bugs":{"url":"https://github.com/DaniAkash/useRedux/issues"},"homepage":"https://github.com/DaniAkash/useRedux#readme","_id":"@daniakash/useredux@0.0.1","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-CHZYehWNgYYYkDkksienYvdeUZqduS4aumbZ3SxwOoUSTgmpqKbfFe+DqZKn1KyJmUx3Hy0LMlUsF8/uoLERWw==","shasum":"08a56b03883ac34cfefe58ddfa85d18845a5376c","tarball":"https://registry.npmjs.org/@daniakash/useredux/-/useredux-0.0.1.tgz","fileCount":10,"unpackedSize":9375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfimbmCRA9TVsSAnZWagAAkRMP/R87pNCiTeXVaHxEz5t9\nZqityR4Go0VQFwQ/Kyg5mnOxtNAyN+aAGDA6UeQwQzND5TK89X8dEsiDNG0m\nDHEaa8KNSDhDHl7y8wyPNB2lgy0YTTI36j93DctSEVDxkL82mkPb/DqRRIGF\nUysdS/LSo7jrxXqoX6v1BbWqKsArXC6iku6EGviyMEj1aQYB/BLxttSFvR+g\nGo/ulRfxlbGOdyP6XuLbfFNGVMH+fNVO60lSVtnzQ9hENWM/mrvqkimrDg0U\nmnt45hiL8IIukDKeAykqR3nsE2EzHgyH5U9IDJY5EQNvHZ9Y9M7+ZrrO6HAf\nED4tx6DFSF8rZ7H7/E2TaZE0bu/ZfXWbWf2iOQopA239Gub8iEAaMu0+DGG9\n5sc+rReQGtfEwsR8+dBbw6G1uG6sjz43FirYcQ473oG+c9AgQmh9BoNME6li\nMv3Y5WfqQuugwSrrJqlPVhzw+nwSO+y+SkO9x8X7aBe25iOQWvcASoQZyo4K\nC0R2yhXfcYFWNWlnz68dG+HU0HpCAPfPn7Dp3xkF/cNrTkMqFlfAX+isUfgG\ngIFs2Lt/DlJQoECLxTImkSWzb5QjijUcg5oBSereYbqJKoSYmFv2+1mUOMP9\nrTd39b7drUSpdtWTOfQ13lOwhiAPqIvJdIZCamsbURdwW7+Gm8PiybKWGMnd\nM7WV\r\n=JZC5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChWiSpGT7lpXIsRE1j5drEYpaXE+6g9TnUAF8qN2SJyQIgCd+YGLbWu6O+b9B5VcpILLlf7SkoK+8OrRcfchDFe74="}]},"maintainers":[{"name":"daniakash","email":"s.daniakash@gmail.com"}],"_npmUser":{"name":"daniakash","email":"s.daniakash@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/useredux_0.0.1_1602905830111_0.10164399544853175"},"_hasShrinkwrap":false},"0.0.2":{"name":"@daniakash/useredux","version":"0.0.2","description":"Hook to connect redux store to react components","author":{"name":"DaniAkash"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DaniAkash/useRedux.git"},"main":"dist/index.js","module":"dist/index.modern.js","source":"src/index.tsx","engines":{"node":">=10"},"scripts":{"build":"microbundle-crl --no-compress --format modern,cjs","start":"microbundle-crl watch --no-compress --format modern,cjs","prepare":"run-s build","test":"run-s test:unit test:lint test:build","test:build":"run-s build","test:lint":"eslint . --no-error-on-unmatched-pattern","test:unit":"cross-env CI=1 react-scripts test --env=jsdom","test:watch":"react-scripts test --env=jsdom","build-web":"yarn install && cd example && yarn install && yarn run build"},"peerDependencies":{"react":"^16.8"},"devDependencies":{"@testing-library/jest-dom":"^4.2.4","@testing-library/react":"^9.5.0","@testing-library/react-hooks":"^3.4.2","@testing-library/user-event":"^7.2.1","@types/jest":"^25.1.4","@types/node":"^12.12.38","@types/react":"^16.9.27","@types/react-dom":"^16.9.7","@typescript-eslint/eslint-plugin":"^2.26.0","@typescript-eslint/parser":"^2.26.0","babel-eslint":"^10.0.3","cross-env":"^7.0.2","eslint":"^6.8.0","eslint-config-prettier":"^6.7.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.18.2","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.1","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.17.0","eslint-plugin-standard":"^4.0.1","gh-pages":"^2.2.0","microbundle-crl":"^0.13.10","npm-run-all":"^4.1.5","prettier":"^2.0.4","react":"^16.13.1","react-dom":"^16.13.1","react-scripts":"^3.4.1","react-test-renderer":"^16.14.0","typescript":"^3.7.5"},"dependencies":{"redux":"^4.0.5"},"gitHead":"53ee397e589a9c52d290d32a77e6e2a11623bc84","bugs":{"url":"https://github.com/DaniAkash/useRedux/issues"},"homepage":"https://github.com/DaniAkash/useRedux#readme","_id":"@daniakash/useredux@0.0.2","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9OTH7zHXe6gpwvXrqSJ3PnCPhDyk0VMKuBVuwMtT3h6XOTTC6+xEIvhp8Nvvn4gZVprwUxub5NCSQncjLMDSsQ==","shasum":"008f7b46d048adc95a8bc933cec65bcb087a00e4","tarball":"https://registry.npmjs.org/@daniakash/useredux/-/useredux-0.0.2.tgz","fileCount":8,"unpackedSize":11428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi+H+CRA9TVsSAnZWagAAZxkP/0IzRJfmrLvJsVM+ipre\nKTAVJs5GnEedQDaip3fua/SDPpqR6Aq1lBSg+um3JpJY/gyjC7wwpbVBBRH2\n7PiaKkfrfgek5IoE01+oRjx8n+E95yfPik53w+OQskxA5GJzShp3sdMz2pPJ\nusAhrRi6wEDFRnwiC+71DnpLKqEWFuFpjwJ9ZWLAa+7Ek2j9gmGY2yO3LYMT\n56bL60HN8Fv/bgfgtgyNQ9KKsEskkjCH+U7CtGMqhNVlaArxtY//vy/mbO4t\nMU7bNpigIeCpVeMULQ83sBuZfsOBqN15MBYRJZinwDQLb0o88yQokcVHlDxM\nT7pC/Mz9V95mcKKrrcpyI+EQhIPJPDmAPFuhud4NcwF4BItk/WFgNZK/Nu4r\nicFnts54O7Lo8BX4qz9112YH6cvPuja+4cbsxx97OtZh5tIXubYdYa2o3ims\nqINZu4Y7QwjDHXbvIBITi67uJZJ7c2IE2acTu0OCUEwJyl2xp1MReqyES0rF\nkLj8nxdtnkP1Ibt6JX8n/bezy/4YkmasBOCpPCgTBE3QqFlEDSnKbBPxUGBv\nUgOB9PEd5tVqTPkIM6BKwQ/K+mH2W+3SMTBgqoENpZC68GZFQNeq6JWDFTX7\nmIDwG9jMNnmh69zIlrTcwHzoLIgL+pZwMawsQSabYodLPwsozn6VZ2lgK0jG\nnGKL\r\n=DF5c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACUkpxskgmyaj6ub3Cv4qGTtAVTCQ0OCI3s3FX5LPucAiEAjFkFKfFZEXo7gdBHze/ulQ2gi7V8LM8kYdGENcvwcIw="}]},"maintainers":[{"name":"daniakash","email":"s.daniakash@gmail.com"}],"_npmUser":{"name":"daniakash","email":"s.daniakash@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/useredux_0.0.2_1603002878119_0.5508942999401474"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-17T03:37:10.072Z","0.0.1":"2020-10-17T03:37:10.250Z","modified":"2022-04-05T02:40:22.463Z","0.0.2":"2020-10-18T06:34:38.215Z"},"maintainers":[{"name":"daniakash","email":"s.daniakash@gmail.com"}],"description":"Hook to connect redux store to react components","homepage":"https://github.com/DaniAkash/useRedux#readme","repository":{"type":"git","url":"git+https://github.com/DaniAkash/useRedux.git"},"author":{"name":"DaniAkash"},"bugs":{"url":"https://github.com/DaniAkash/useRedux/issues"},"license":"MIT","readme":"<div align=\"center\">\n\n# useRedux 🪐\n\nHook to connect redux store to react components\n\n[![Build Status][build-badge]][build]\n[![Maintainability][maintainability-badge]][maintainability-url]\n[![Test Coverage][coverage-badge]][coverage-url]\n\n[![Version][version-badge]][package]\n[![Downloads][downloads-badge]][npmtrends]\n[![Bundlephobia][bundle-phobia-badge]][bundle-phobia]\n\n[![Star on GitHub][github-star-badge]][github-star]\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Twitter Follow][twitter-badge]][twitter]\n\n[![donate][coffee-badge]][coffee-url]\n[![sponsor][sponsor-badge]][sponsor-url]\n[![support][support-badge]][support-url]\n\n### PRs Welcome 👍✨\n\n</div>\n\n## Motivation\n\nThe goal of this library is to provide a simple API to connect your React components to the Redux store. It achieves this by using a single hook `useRedux` that subscribes to the state updates in redux store without any need for the traditional `Provider` or `connect` components.\n\n## Installation\n\n```bash\nyarn add @daniakash/useredux\n\n#or\n\nnpm i @daniakash/useredux\n```\n\n## Usage\n\nRedux store of a simple counter ﹣\n\n```tsx\nimport { createStore } from 'redux'\n\nconst countReducer = (\n  prevState = 0,\n  action: { type: 'increment' | 'decrement' }\n): number => {\n  switch (action.type) {\n    case 'increment':\n      return prevState + 1\n\n    case 'decrement':\n      return prevState - 1\n\n    default:\n      return prevState\n  }\n}\n\nconst countStore = createStore(countReducer)\n\nexport default countStore\n```\n\nConnecting the countStore to React using `useRedux` ﹣\n\n```tsx\nimport React, { Component } from 'react'\nimport countStore from './countStore'\nimport useRedux from '@daniakash/useredux'\n\nconst Count = () => {\n  const count = useRedux(countStore)\n\n  return <h1>{count}</h1>\n}\n\nconst Controller = () => {\n  const decrement = () =>\n    countStore.dispatch({\n      type: 'decrement'\n    })\n\n  const increment = () =>\n    countStore.dispatch({\n      type: 'increment'\n    })\n\n  return (\n    <div>\n      <button onClick={decrement}>➖</button>\n      <button onClick={increment}>➕</button>\n    </div>\n  )\n}\n\nexport default function App() {\n  return (\n    <div className='App'>\n      <Count />\n      <Controller />\n    </div>\n  )\n}\n```\n\n### Working with multiple reducers\n\nIf your store has multiple reducers, you can subscribe to the individual reducers by passing the key of the reducer as the second argument to `useRedux`\n\nIf your reducer is ﹣\n\n```tsx\nconst rootReducer = combineReducers({\n  todos: todosReducer,\n  visibilityFilter: visibilityFilterReducer\n})\n\nconst store: Store<ApplicationState> = createStore(rootReducer)\n```\n\nTo make your component subscribe to updates only on the todosReducer ﹣\n\n```tsx\nconst todos = useRedux(store, 'todos')\n```\n\n## License\n\nMIT © [DaniAkash](https://github.com/DaniAkash)\n\n[coffee-badge]: https://img.shields.io/badge/-%E2%98%95%EF%B8%8F%20buy%20me%20a%20coffee-e85b46\n[coffee-url]: https://www.buymeacoffee.com/daniakash\n[sponsor-badge]: https://img.shields.io/badge/-%F0%9F%8F%85%20sponsor%20this%20project-e85b46\n[sponsor-url]: https://www.buymeacoffee.com/daniakash/e/6983\n[support-badge]: https://img.shields.io/badge/-Get%20Support-e85b46\n[support-url]: https://www.buymeacoffee.com/daniakash/e/7030\n[build]: https://github.com/react-native-toolkit/useRedux/actions\n[build-badge]: https://github.com/react-native-toolkit/useRedux/workflows/build/badge.svg\n[coverage-badge]: https://api.codeclimate.com/v1/badges/a17808d5e49c028fc7b9/test_coverage\n[coverage-url]: https://codeclimate.com/github/react-native-toolkit/useRedux/test_coverage\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/a17808d5e49c028fc7b9/maintainability\n[maintainability-url]: https://codeclimate.com/github/react-native-toolkit/useRedux/maintainability\n[bundle-phobia-badge]: https://badgen.net/bundlephobia/minzip/@daniakash/useredux\n[bundle-phobia]: https://bundlephobia.com/result?p=@daniakash/useredux\n[downloads-badge]: https://img.shields.io/npm/dm/@daniakash/useredux.svg\n[npmtrends]: http://www.npmtrends.com/@daniakash/useredux\n[package]: https://www.npmjs.com/package/@daniakash/useredux\n[version-badge]: https://img.shields.io/npm/v/@daniakash/useredux.svg\n[twitter]: https://twitter.com/dani_akash_\n[twitter-badge]: https://img.shields.io/twitter/follow/dani_akash_?style=social\n[github-watch-badge]: https://img.shields.io/github/watchers/react-native-toolkit/useredux.svg?style=social\n[github-watch]: https://github.com/react-native-toolkit/useredux/watchers\n[github-star-badge]: https://img.shields.io/github/stars/react-native-toolkit/useredux.svg?style=social\n[github-star]: https://github.com/react-native-toolkit/useredux/stargazers\n","readmeFilename":"README.md"}