{"_id":"@bytesoftio/use-local-store","_rev":"4-4321b8acb9245b5f604413857100acff","name":"@bytesoftio/use-local-store","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bytesoftio/use-local-store","version":"1.0.0","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","release":"yarn run build && np"},"dependencies":{"@bytesoftio/use-store":"^1.0.0","lodash":"^4.17.15"},"peerDependencies":{"react":"^16.13.0","react-dom":"^16.13.0"},"devDependencies":{"@types/enzyme":"^3.10.5","@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","@types/react":"^16.9.23","@types/react-dom":"^16.9.5","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.2","jest":"^25.1.0","react":"^16.13.0","react-dom":"^16.13.0","ts-jest":"^25.2.1","typescript":"^3.8.3"},"description":"# @bytesoftio/use-local-store","_id":"@bytesoftio/use-local-store@1.0.0","dist":{"shasum":"b850c289c0dc7cc1f2e088b15d0b505c0e025723","integrity":"sha512-D8IqWgSyNxWFfIVq7mJfeiEDPo90esraVKGBagq0CiCl+3cOUmGqjfgwO8k/T6hvmodmnqvWoqwVJMGJct76dA==","tarball":"https://registry.npmjs.org/@bytesoftio/use-local-store/-/use-local-store-1.0.0.tgz","fileCount":14,"unpackedSize":4571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepww3CRA9TVsSAnZWagAAUccP/1BPAx0K8rSj0cxTJdpM\nHce43YeeWxzcVNEwv3VLWPP6ZHk7UExfs32tniFALBFzp8B6Mcjf7cp3Z+lK\nsL/4t0lnBo6bBQUltmcVBSUS7EXPL92hEiofm0XJbyP5dUcOIPbGFf8V36F/\nXXS1ZwkQljw2PpJUVm0CKO/d0MZsI21Pj94aR6zBNtx35BcjGx+JmhlAVMCm\nXv/kaHUTePpMOqm4nLVHvsiD3i/O/4RBPlwRZYKb8Cl7pY2upqbBtnrrhkiJ\nUJChNsDvc11JCXnc5POQrcpc8Rxg7WKjJ6ur8h6FZBX3mKuzn2do4vVHzuTg\nHZQkJDZwEHMkNksKu4FnEODKKdaHJs8POxEItgRwlRuoO5itWquCDZ59YWOs\nN65pH4RyH0YjiYclECKxBAzrNAefiSW2kLDV7m8abYWBcQPgcRKNNNkwQljt\nyT2chhqnlB61ZJkTjM+XZ3O3Zb3cfz+ncfAXnH9f/XNuxuw8Tg7b/jY3vd5v\nSi3vz94MfmIheNJmJd0gOlWoW210c7bM4JIcayDpXmbE88f7fp+9/3I5ANIu\nykUcTnEFtehMzAPQDrWHPbKZPMHef908n+sYU/XhctRLrihI9jbmzAu4DEbI\n9EuB3R//qPS4olaR3lv6ThBTY5D5vV7zy1qPxIo8qAm/r9kTvUPODY1blk7D\ndTsi\r\n=MLN2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgBmPWecPDFi3OrTCu7Lm8/n2b4FmQja6P3xHDY7rJ+AIgTMmnISecLPQwRiAW15J0kltpIJOBClHG+zJV2AtKP7I="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-local-store_1.0.0_1588005943105_0.5075921549530598"},"_hasShrinkwrap":false,"deprecated":"unused"},"1.0.1":{"name":"@bytesoftio/use-local-store","version":"1.0.1","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","release":"yarn run build && np"},"dependencies":{"@bytesoftio/use-store":"^1.0.0","lodash":"^4.17.15"},"peerDependencies":{"react":"^16.13.0","react-dom":"^16.13.0"},"devDependencies":{"@types/enzyme":"^3.10.5","@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","@types/react":"^16.9.23","@types/react-dom":"^16.9.5","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.2","jest":"^25.1.0","react":"^16.13.0","react-dom":"^16.13.0","ts-jest":"^25.2.1","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/use-local-store@1.0.1","dist":{"shasum":"258c226899c60c6da327effe51254e9d3a982be5","integrity":"sha512-B6h8k2hB+aHxC3ehz2n4jugznCQqRi9rNWMMZFYNip7YHTzW0HENasjGEtTZGWoiQUlT7tWzbtqMwxe7n+pFyw==","tarball":"https://registry.npmjs.org/@bytesoftio/use-local-store/-/use-local-store-1.0.1.tgz","fileCount":14,"unpackedSize":4535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepw4GCRA9TVsSAnZWagAAzGkP/02ZC36a1WAwBOmDFBBn\n5aXeg1sLILx75e3ZEIlZkUawqy4nmqCcHLxcblEMrKlJ98Rlwpb8Hndx0mLL\n/FsKyVLfdLuKnj6An3WrOpuJRLsl7l6l+40N6e/EQe7GafmISeTodDxsjVEB\nlhpIzUDm1dT7x243wV8FvuN5NdmBVQNNhh2fnTHWZUoKhrTd4UNan7P1F5lF\n22WYjn8kQQJML/jnndg/SFrazA6WUnvwQrkfNx9R8Oe4cBJ0VN4oYAeuO5bh\nM6YbFgcWAfBYjC4EnGXQHIBgHDIA2AoA2gtKAa+OdjFTyiP1WdVcJoNcbvtY\nflFJZNdyzE7W88xqSAA8ixooXGmRX9slsVBCvcrRBnZjT7NVqBMdk7v9UghL\nThhe7DasWTB2ikn18x09CLbM/LKxCK38llfuDrRmnfV4AD7JRSlSiQpD31X3\nDUE1SMQPTK0BbkrC34Vauh6IuthJnq8/G3ot53u5LF6TmmWBulKB3GjkeUAx\nMTjWY2/+/pxTbuqiBu+/58sSx+852DFqeaBm2qOy3v//0TAV08SJv0ZOH5sq\nv/1XAA87684LU3pNDg56rqayDk4jvgRxQHYcMFHnDNl6+FTpDpgTMqqe2ntr\nSsZN1iYg0Lm/Z/6eQpiMfEi3NMOnyLgobvz61/qQe7WsY8wotcQq6/Vur7Sv\nWMmh\r\n=WxPO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMeBqiFylbR0DlXKTgBUNwMIwmihst5Qs+tyHyz7C4QwIgeqS2zDJq4kLNoW/rjpbqC/nXcaOSgDI1Lt35fS7xHOg="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-local-store_1.0.1_1588006405989_0.4229564637913279"},"_hasShrinkwrap":false,"deprecated":"unused"},"1.0.2":{"name":"@bytesoftio/use-local-store","version":"1.0.2","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bytesoftio/use-local-store.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","docs":"doctoc readme.md && typedoc src/index.ts --out docs --hideGenerator --tsconfig tsconfig.build.json --mode library --theme minimal","release":"yarn run build && np"},"dependencies":{"@bytesoftio/use-store":"^1.0.0","lodash":"^4.17.15"},"peerDependencies":{"react":"^16.13.0","react-dom":"^16.13.0"},"devDependencies":{"@types/enzyme":"^3.10.5","@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","@types/react":"^16.9.23","@types/react-dom":"^16.9.5","doctoc":"^1.4.0","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.2","jest":"^25.1.0","react":"^16.13.0","react-dom":"^16.13.0","ts-jest":"^25.2.1","typedoc":"^0.17.0-3","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/use-local-store@1.0.2","dist":{"shasum":"ad6ddea805497a7471de1cd1cc83af5c9e12795b","integrity":"sha512-whQIX6+tRQCr7ArDmJK9m/Zc4lxCafueyhr7THHdJjBZpH2xZSCoaIgApdmLQTBuzw7L3Svw8dFXGQLg9rrWaA==","tarball":"https://registry.npmjs.org/@bytesoftio/use-local-store/-/use-local-store-1.0.2.tgz","fileCount":14,"unpackedSize":5129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq0jACRA9TVsSAnZWagAAVRUP/AlFbzC4t2SEYusSYPPY\nv19kZI5OmYeOJhBsAZObbBW7mb0hJ1U8tNDJX/wyLY3ZrO/43CCnWALoMurx\nITE5YcvA4/W2uHijDfw6gSs1UTVzmijbAY9kLdj89TKvteSQTjWT+7i7IICh\nO5v+O/DzjlOVDmm5IguQzHyLWUQVcocjbwnjGdtZOzooMZxO5sxDvP56LKk+\nWH9YKsoDl5DiIjOgJyhf8PsnZ6NALrvd/vXUEFpMEmhRmgF2N6hzofcVqNVW\nFJhEUUhIINmaBJ38JYP7ONG7w6Y4/abU+13tmOTlmM0+WbTz/XCbxVHhry2o\nHKFP1zx0d6R6zWy6hv+wAFvI9TfjTC/ujlCk0yYzmcG4HknqzeZAdoAT8WTt\nDIIh2VIFcM7VG3CJPtUZiN66evXaloepwcQGZpJNXYK1M/7YpVQVlrbd7+eG\nMLvOgpedXPDaT5XaFG58lDN9Is4/NCCC+NzFTUtrTTEfnFGQxbSkxED7DA+U\nzfmlhMZ3KV1MpiJtKhD/Ts+S5K+b7AY8SZI5Wt8XBXQVeKZJWZUL2+RGU4gJ\n+pq29KVuMMMUn8YkPOzyEYSVrs0oJNebXVUcmjyoJFC6oHDc/15eaCLfBrf4\nEmlbMsR3eHQerKSMgdj5Lwe+VGVfqk4l6J7vY8S/r6gXhQDRa/EilLelfcC/\nIUFv\r\n=td8X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcPhQTrTrub30jHhmR7mTTiY41JMur7vuDRq2xigNGOQIgd+24guo+mZMFg3xhmlDOVTTr8NZxi3XxtWRvFY9xS3Q="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-local-store_1.0.2_1588283584534_0.09972309550554415"},"_hasShrinkwrap":false,"deprecated":"unused"}},"time":{"created":"2020-04-27T16:45:40.626Z","1.0.0":"2020-04-27T16:45:43.206Z","modified":"2022-04-04T21:22:28.436Z","1.0.1":"2020-04-27T16:53:26.158Z","1.0.2":"2020-04-30T21:53:04.635Z"},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"description":"## Installation","author":{"name":"Maxim Kott"},"license":"MIT","readme":"# @bytesoftio/use-local-store\n\n## Installation\n\n`yarn add @bytesoftio/use-local-store` or `npm install @bytesoftio/use-local-store`\n\n## Table of contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n\n- [Description](#description)\n- [Usage](#usage)\n  - [createLocalStore](#createlocalstore)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Description\n\nThis package is built on top of `@bytesoftio/use-store` and provides an integration with localStorage. This way your\napplication state can survive page reloads, etc. Check out the docs of the other package to find a more in depth guide.\n\n## Usage\n\n### createLocalStore\n\nSince `@bytesoftio/use-store` is used underneath, stores produced by this and the other package are interchangeable. \nA store created by `createLocalStore` can be used with `useStore` from the other package.\n\n```tsx\nimport React from \"react\"\nimport { createLocalStore } from \"@bytesoftio/use-local-store\"\nimport { useStore } from \"@bytesoftio/use-store\"\n\n// state shared between components and services, cached in localStorage\nconst authStore = createLocalStore(\"auth\", { token: \"abcde\" })\n\nconst Component = () => {\n  const [state, setState, addState, resetState] = useStore(authStore)\n  // local component state, created through an initializer function, cached in localStorage\n  const [persistentState, setPersistentState] = useStore(() => createLocalStore(\"counter\", {count: 0}))\n\n  const increment = () => setPersistentState({count: persistentState.count + 1})\n\n  return (\n    <div>\n      <span>Auth token: {state.token}</span>\n      <button onClick={increment}>{persistentState.count}</button>\n    </div>\n  )\n}\n```","readmeFilename":"readme.md","repository":{"type":"git","url":"https://github.com/bytesoftio/use-local-store.git"}}