{"id":16234106,"url":"https://github.com/zackify/redux-restore","last_synced_at":"2025-07-13T00:39:36.320Z","repository":{"id":57351401,"uuid":"50213471","full_name":"zackify/redux-restore","owner":"zackify","description":"Handles storage in React Native","archived":false,"fork":false,"pushed_at":"2016-01-23T21:35:58.000Z","size":5,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-20T23:48:42.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zackify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T23:16:10.000Z","updated_at":"2019-01-06T15:05:03.000Z","dependencies_parsed_at":"2022-08-31T06:21:58.214Z","dependency_job_id":null,"html_url":"https://github.com/zackify/redux-restore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zackify/redux-restore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackify%2Fredux-restore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackify%2Fredux-restore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackify%2Fredux-restore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackify%2Fredux-restore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackify","download_url":"https://codeload.github.com/zackify/redux-restore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackify%2Fredux-restore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261088027,"owners_count":23107659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T13:15:01.179Z","updated_at":"2025-07-13T00:39:36.274Z","avatar_url":"https://github.com/zackify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"##redux-restore\n\nThis is a simple wrapper around async storage that saves your store data to `AsyncStorage` in react native. Works with Android and iOS! Tested on `0.18`\n\n##Install\n\n```js\nnpm install redux-restore --save\n```\n\n##Setup\n\n###Register Middleware\n\nCreate your store with the `storage` middleware\n\n```js\nimport { combineReducers, applyMiddleware, createStore } from 'redux'\nimport items from './items'\nimport authentication from './authentication' //reducer name\nimport { storage } from 'redux-restore'\n\nlet createStoreWithMiddleware = applyMiddleware(\n  storage(['authentication']) //reducer name\n)(createStore)\n\nlet reducers = combineReducers({\n  items,\n  authentication\n})\n\nexport default createStoreWithMiddleware(reducers)\n```\n\nPass an array with reducer names. Each one you pass will be saved to storage.\n\n###Use RestoreProvider\n\nUse this instead of the usual `Provider` from redux. When you load the app, it will dispatch from storage with the current state, if there is any.\n\n```js\nimport React from 'react-native'\nimport Scene from './scene'\nimport store from '../../reducers'\nimport { RestoreProvider } from 'redux-restore'\n\nexport default class App extends React.Component {\n  render() {\n    return (\n      \u003cRestoreProvider store={store}\u003e\n        \u003cScene /\u003e\n      \u003c/RestoreProvider\u003e\n    );\n  }\n}\n```\n\n###Add an action to your reducer\n\n```js\ncase 'authentication':\n  delete action.type\n  return Immutable.Map(action)\n```\n\nCreate a new case with the name of your reducer. This will be called with all of the stored state.\n\nThat's it! You're all set!\n\n###Conclusion\n\nThis library is one of the nicest AsyncStorage wrappers I've seen. The only problem I see is the way the state is restored. I think the `RestoreProvider` component could be done better.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackify%2Fredux-restore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackify%2Fredux-restore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackify%2Fredux-restore/lists"}