{"bugs":{"url":"https://github.com/dance2die/react-use-localstorage/issues"},"dist":{"shasum":"de623942e6d65ae664d9b6246631717e4d1cc294","tarball":"https://registry.npmjs.org/react-use-localstorage/-/react-use-localstorage-3.1.2-alpha.3.tgz","fileCount":15,"integrity":"sha512-E++fdGjJaqAf20/rjdEDxD4f+EixpdAd3U5PdNcDDUwZmGKc/9NY0/l8yqoLMdHu5XoKk6Bhsn4DmOKFDpXyUw==","signatures":[{"sig":"MEYCIQCBv+A36eqSJ9O0SkqS2eLit3FRabFQUaGPgxtq7RV7IAIhAKKKJVgTG8cb9+1pif87qeYvaHrwJ2RXUwpqAKcweXAq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBWsrCRA9TVsSAnZWagAA3kEP/3aBKojyuOi6BPK4Cj9R\nSeVPyxjcTIX9JAJG2LhJqgpMWXpdqYdy0ui8b1A4r8rbmY9M9RX2XlnypZDG\n4tdV9Kkel9uK3tOVmwnheAq86uRhjvYkfFuXSUnaWyAYEoN2ZgIg5dk2P190\nOQgas50lDeguqeFDNaHugYRVzoaVfG3ukCy5b8rAaut1HO0QMydxMVCD81h3\nEN4g1E1v1us5xr2LRhoTmpcbMzdL9P4yUO5S7BMVvWjHvmZd1YDRDuUPBpH9\nCMWaqeokJst0xot9BVPWv4+qYqM795Jpct67sbdg97yvB5zvHiF9Nrrsp3u8\n2oYZ36TeaXVDkZpoRT9BPJ1t+SzjvLtHBMyO1kEqcaqk2JR+RzNc/Sp/1Bez\n9FR09FWciMc25SSUqqRnkAdW3b/PxHQ2RU1uOkaQmDRkERyLLChr5AWI9Wvv\nk2lwuopEDQ90ZW2ZvUpOp+C4iP/OAjvNz1lbPndQr6vL+Xb0XuvUEMvtJ+jV\n8xlys+4OHUAjE7UHY/s0zNduEiFF3lcn1xvGkxywXfkZJLHY5UTwC2ZPz+Ns\nvNB9MScPNahzhlzPf5IA0PhBktHk97BRBVZd/bQmQlO7GNBw3pBmXatqoAvw\n2etAQjMMJd1kpg1T0miahgOxA6Vq4U5/Ujm+qwngyfL2J1F1x2OzIVbTWLgv\naTff\r\n=gHO4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/react-use-localstorage.es.production.js","name":"react-use-localstorage","husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"author":{"name":"Sung Kim","email":"sungmkim80@gmail.com"},"module":"dist/react-use-localstorage.es.production.js","readme":"# react-use-localstorage\r\n\r\n[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)\r\n\r\n_depends on stable v16.8.1~_\r\n\r\n![version](https://img.shields.io/npm/v/react-use-localstorage.svg?style=flat-square)\r\n![size](https://img.shields.io/bundlephobia/min/react-use-localstorage.svg?style=flat-square)\r\n![minzippedsize](https://img.shields.io/bundlephobia/minzip/react-use-localstorage.svg?style=flat-square)\r\n\r\nAccess [Local Storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) using [React hooks](https://reactjs.org/docs/hooks-intro.html).\r\n\r\nFork it on CodeSandbox\r\n[![Edit usestate-useeffect](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/09xj95vxl)\r\n\r\n## How to use it\r\n\r\n```javascript\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport useLocalStorage from 'react-use-localstorage';\r\n\r\nimport './styles.css';\r\n\r\nfunction App() {\r\n  const [item, setItem] = useLocalStorage('name', 'Initial Value');\r\n\r\n  return (\r\n    <div className=\"App\">\r\n      <h1>Set Name to store in Local Storage</h1>\r\n      <div>\r\n        <label>\r\n          Name:{' '}\r\n          <input\r\n            type=\"text\"\r\n            placeholder=\"Enter your name\"\r\n            value={item}\r\n            onChange={e => setItem(e.target.value)}\r\n          />\r\n        </label>\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nconst rootElement = document.getElementById('root');\r\nReactDOM.render(<App />, rootElement);\r\n```\r\n\r\n## Demo\r\n\r\n![demo](https://github.com/dance2die/react-use-localstorage/raw/master/react-use-localstorage.gif)\r\n\r\n## Changelog\r\n\r\n<details>\r\n<summary><b>Expand Changelog</b></summary>\r\n\r\n3.0.0\r\n\r\nDecided to go with @TheAifam5 the following breaking change as the type is derived from React type definition.\r\n\r\n- Breadking change: `setIteme` type is changed from `(item: string) => void` () to `React.Dispatch<string>`\r\n- Updated infrastructure by @TheAifam5 🙏 in [PR #13](https://github.com/dance2die/react-use-localstorage/pull/13)\r\n\r\n  - Dropped babel in favor of `tsc` + `uglifyjs`\r\n  - Replaced npm with yarn\r\n  - Added husky for pre-commit git hooks\r\n  - Source map has been dropped from distribution\r\n  - distribution is moved from `dist` to `lib` folder\r\n\r\n  2.4.1\r\n\r\n- Added `useLocalStorage` return type explicitly to generate correct `index.d.ts` typing file.\r\n\r\n  2.4.0\r\n\r\n- Added TypeScript typings as suggested by @TheAifam5 in Issue #9\r\n\r\n  2.3.0\r\n\r\n- Fixed a bug where initial value is returned all the time #7 by @lilasquared 🙏\r\n\r\n  2.2.0\r\n\r\n- Sets initial value in local storage\r\n\r\n  2.1.0\r\n\r\n- Can optionally pass an initial value\r\n- This is to prevent form field from being uncontrolled.\r\n\r\n  2.0.0\r\n\r\n- Breaking change - `setItem` doesn't require `key`\r\n\r\n  1.1.1\r\n\r\n- Updated to React v16.8.1, which contains the patched Hooks\r\n\r\n  1.1.0\r\n\r\n- Updated dev dependency version\r\n\r\n  1.0.0\r\n\r\n- Updated to React v16.8.0, which contains the stable Hooks\r\n\r\n  0.0.6\r\n\r\n- Changed the language from JavaScript to TypeScript\r\n- It has minimized the distribution file greatly\r\n  </details>\r\n\r\n## Contributors\r\n\r\nThanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):\r\n\r\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\r\n<!-- prettier-ignore -->\r\n<table><tr><td align=\"center\"><a href=\"https://github.com/lilasquared\"><img src=\"https://avatars3.githubusercontent.com/u/3036779?v=4\" width=\"100px;\" alt=\"Aaron Roberts\"/><br /><sub><b>Aaron Roberts</b></sub></a><br /><a href=\"#ideas-lilasquared\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/dance2die/react-use-localstorage/issues?q=author%3Alilasquared\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/dance2die/react-use-localstorage/commits?author=lilasquared\" title=\"Code\">💻</a></td><td align=\"center\"><a href=\"https://twitter.com/dance2die\"><img src=\"https://avatars1.githubusercontent.com/u/8465237?v=4\" width=\"100px;\" alt=\"Sung Kim\"/><br /><sub><b>Sung Kim</b></sub></a><br /><a href=\"https://github.com/dance2die/react-use-localstorage/commits?author=dance2die\" title=\"Code\">💻</a> <a href=\"https://github.com/dance2die/react-use-localstorage/issues?q=author%3Adance2die\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/dance2die/react-use-localstorage/commits?author=dance2die\" title=\"Documentation\">📖</a></td><td align=\"center\"><a href=\"https://theaifam5.eu/\"><img src=\"https://avatars3.githubusercontent.com/u/2192274?v=4\" width=\"100px;\" alt=\"TheAifam5\"/><br /><sub><b>TheAifam5</b></sub></a><br /><a href=\"#ideas-TheAifam5\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/dance2die/react-use-localstorage/commits?author=TheAifam5\" title=\"Code\">💻</a> <a href=\"#infra-TheAifam5\" title=\"Infrastructure (Hosting, Build-Tools, etc)\">🚇</a></td><td align=\"center\"><a href=\"http://vitorluizc.github.io\"><img src=\"https://avatars1.githubusercontent.com/u/9027363?v=4\" width=\"100px;\" alt=\"Vitor Luiz Cavalcanti\"/><br /><sub><b>Vitor Luiz Cavalcanti</b></sub></a><br /><a href=\"https://github.com/dance2die/react-use-localstorage/commits?author=VitorLuizC\" title=\"Code\">💻</a></td></tr></table>\r\n\r\n<!-- ALL-CONTRIBUTORS-LIST:END -->\r\n\r\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\r\n","gitHead":"57d17c5648bfee46a63e7cb57ea5d992007ec633","license":"MIT","scripts":{"test":"tsdx test --env=jsdom","build":"tsdx build","start":"tsdx watch"},"typings":"dist/index.d.ts","_npmUser":{"name":"dance2die","email":"dance2die@hotmail.com"},"homepage":"https://github.com/dance2die/react-use-localstorage","keywords":["localStorage","react","hooks"],"umd:main":"dist/react-use-localstorage.umd.production.js","repository":{"url":"git+https://github.com/dance2die/react-use-localstorage.git","type":"git"},"_npmVersion":"6.9.0","description":"Use Local Storage with React hooks","directories":{},"maintainers":[{"name":"dance2die","email":"dance2die@hotmail.com"}],"_nodeVersion":"10.16.0","contributors":[{"name":"lilasquared","email":"aaronmroberts1@gmail.com"},{"url":"https://theaifam5.eu/","name":"TheAifam5","email":"theaifam5@gmail.com"},{"url":"http://vitorluizc.github.io/","name":"VitorLuizC","email":"vitorluizc@outlook.com"}],"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsdx":"^0.6.1","husky":"^2.4.1","react":"^16.8.6","tslib":"^1.10.0","prettier":"^1.18.2","react-dom":"^16.8.6","typescript":"^3.5.1","@types/jest":"^24.0.13","@types/react":"^16.8.19","pretty-quick":"^1.11.0","@types/react-dom":"^16.8.4"},"peerDependencies":{"react":"^16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react-use-localstorage_3.1.2-alpha.3_1560636202519_0.48359695889349275","host":"s3://npm-registry-packages"},"_id":"react-use-localstorage@3.1.2-alpha.3","version":"3.1.2-alpha.3"}