{"_id":"@abradley2/redux-dev-state-persist","_rev":"3-30d0ee1cceab4d9c1bc500f3f0fdd3b7","name":"@abradley2/redux-dev-state-persist","description":"Simple state persistence for developing with redux","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@abradley2/redux-dev-state-persist","version":"1.0.0","description":"Simple state persistence for developing with redux","main":"dist.js","scripts":{"test":"standard","lint":"standard --fix","build":"browserify ./redux-dev-state-persist -t bubleify -g uglifyify --standalone reduxDevStatePersist -o ./dist.js"},"repository":{"type":"git","url":"git+https://github.com/abradley2/redux-dev-state-persist.git"},"author":{"name":"Tony Bradley"},"license":"MIT","bugs":{"url":"https://github.com/abradley2/redux-dev-state-persist/issues"},"homepage":"https://github.com/abradley2/redux-dev-state-persist#readme","devDependencies":{"browserify":"^14.5.0","bubleify":"^0.7.0","standard":"^10.0.3","uglifyify":"^4.0.4"},"dependencies":{"deep-equal":"^1.0.1","localforage":"^1.5.3"},"_id":"@abradley2/redux-dev-state-persist@1.0.0","_shasum":"777397908b1303251ab81063029b322db665e871","_from":"Desktop/git/redux-dev-state-persist","_resolved":"file:Desktop/git/redux-dev-state-persist","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"dist":{"shasum":"777397908b1303251ab81063029b322db665e871","tarball":"https://registry.npmjs.org/@abradley2/redux-dev-state-persist/-/redux-dev-state-persist-1.0.0.tgz","integrity":"sha512-8R1Jc+ZZI9yuWuqZlJfbKD04SypNbRaUpxJuPZFsgC/yqDSug2kELFKDphGZQHu8jVqoXSwa6DHM3a3WeD/Vnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbIQqhcsmMzfnE2JkuRAwci5OrOjukO3dQv1tE0cI+ZQIgV2qXDN2Q2kilA4iUvaZ7gVbiFPNALSNsKQL5+VDtBkY="}]},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-dev-state-persist-1.0.0.tgz_1509897151746_0.38551157526671886"}},"1.0.1":{"name":"@abradley2/redux-dev-state-persist","version":"1.0.1","description":"Simple state persistence for developing with redux","main":"dist.js","scripts":{"test":"standard","lint":"standard --fix","build":"browserify ./redux-dev-state-persist -t bubleify -g uglifyify --standalone reduxDevStatePersist -o ./dist.js"},"repository":{"type":"git","url":"git+https://github.com/abradley2/redux-dev-state-persist.git"},"author":{"name":"Tony Bradley"},"license":"MIT","bugs":{"url":"https://github.com/abradley2/redux-dev-state-persist/issues"},"homepage":"https://github.com/abradley2/redux-dev-state-persist#readme","devDependencies":{"browserify":"^14.5.0","bubleify":"^0.7.0","standard":"^10.0.3","uglifyify":"^4.0.4"},"dependencies":{"fast-deep-equal":"^1.0.0","localforage":"^1.5.3"},"gitHead":"2404be996fc207c9972584382d20daf7f8c66ea0","_id":"@abradley2/redux-dev-state-persist@1.0.1","_shasum":"a44df84105443ae23679e4a7b2f96a89b6227465","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"dist":{"shasum":"a44df84105443ae23679e4a7b2f96a89b6227465","tarball":"https://registry.npmjs.org/@abradley2/redux-dev-state-persist/-/redux-dev-state-persist-1.0.1.tgz","integrity":"sha512-NETUQKM7Jf4YtELLqR0FF7gUtcdCD62M1UiXPoeCuZbIxezabB6U/HGMwELtonU+4SBnqNMZOcf7XrbFJkPypg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHI/ow6zecEbfJ0eDwNKKRTe2TZW05U1TfKZ29/muim9AiEAtvmpJNScrNiit2XLg0b8aX+A536bRcZHSBVj4kBfXrU="}]},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-dev-state-persist-1.0.1.tgz_1509902684876_0.7649101833812892"}}},"readme":"# Redux Dev State Persist\n\n_Redux Dev State Persist_ (RDSP) provides hot-reloading without having to use any sort of Browserify or\nWebpack plugin- and no mucking about with specific hot-reloading integrations API.\nJust persist your state!\n\n### Installation\n\n`npm install --save-dev @abradley2/redux-dev-state-persist`\n\n### Motivation\n\nWhen using Redux, all that you really need for the \"hot-reloading\" functionality\nis to save your store's state between reloads. This module does exactly that.\n\nIt uses `localforage` as the persistence engine, which will default to indexedDB\nif available. So if you wish to clear your state you can do so by using your\nbrowsers development tools and clearing indexedDB  \n\n**Smart state-reloading**  \nIt is super annoying when persistence reloads old state\neven though you've changed what initial state a store will have. RDSP will\nautomatically refresh your reloaded state instead of overwriting if it detects\nyou've made changes to what your store's initial state is. If you divide your\nstate between modules, this is on a per-module basis.\n\n\n### Usage\n\nInitiate RDSP by providing a namespace to keep in story (\"myReduxAppState\" or something)\nand as the second argument your Redux store.\n\nInitialization returns a promise that resolves when it is finished, or you can provide a\ncallback as the final argument. Be sure you do not dispatch anything between the start and end\nof initialization.\n\n```\nconst rdsp = require('redux-dev-state-persist')\nconst store = require('./store')\nconst ReactDOM = require('react-dom')\nconst App = require('./App')\n\nconst startApp = () => ReactDOM.render(<App />, document.body)\n\nrdsp('myReduxAppState', store)\n  .then(startApp)\n  .catch(err => {\n    console.error('some error loading state!')\n    startApp()\n  })\n```\n\n### Caveats\nYou store's state should be entirely serializable as JSON.\n\nRedux technically allows you to add whatever into your store- even objects\nthat aren't serializable as JSON. This will be persisted differently in\nindexedDB than in your store, which is not desirable behavior.\n\n\n### Production\n\nYou probably don't want to use this in production, so I recommend\nconditionally assigning RDSP to an empty Promise resolving function\n\n```\nconst persistStore = () => proces.env.NODE_ENV === 'development'\n  ? require('redux-dev-state-persist')\n  : () => Promise.resolve()\n```\n\nYou can add in environment variables via Webpack, or Browserify (for Browserify,\ncheck out [envify](https://github.com/hughsk/envify)).\n\n### License\n[MIT](http://unlicense.org/)","maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"time":{"modified":"2022-06-12T14:15:14.144Z","created":"2017-11-05T15:52:32.998Z","1.0.0":"2017-11-05T15:52:32.998Z","1.0.1":"2017-11-05T17:24:45.815Z"},"homepage":"https://github.com/abradley2/redux-dev-state-persist#readme","repository":{"type":"git","url":"git+https://github.com/abradley2/redux-dev-state-persist.git"},"author":{"name":"Tony Bradley"},"bugs":{"url":"https://github.com/abradley2/redux-dev-state-persist/issues"},"license":"MIT","readmeFilename":"README.md"}