{"id":13394476,"url":"https://github.com/redux-offline/redux-offline","last_synced_at":"2025-05-13T16:06:07.060Z","repository":{"id":38994011,"uuid":"84671793","full_name":"redux-offline/redux-offline","owner":"redux-offline","description":"Build Offline-First Apps for Web and React Native","archived":false,"fork":false,"pushed_at":"2025-02-26T09:57:45.000Z","size":3217,"stargazers_count":6141,"open_issues_count":103,"forks_count":396,"subscribers_count":85,"default_branch":"develop","last_synced_at":"2025-04-30T16:11:36.680Z","etag":null,"topics":["hacktoberfest","offline-capable","react","react-native","redux"],"latest_commit_sha":null,"homepage":"https://redux-offline.github.io/redux-offline/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redux-offline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-11T18:37:50.000Z","updated_at":"2025-04-28T20:57:20.000Z","dependencies_parsed_at":"2025-03-16T18:44:23.194Z","dependency_job_id":null,"html_url":"https://github.com/redux-offline/redux-offline","commit_stats":{"total_commits":263,"total_committers":59,"mean_commits":"4.4576271186440675","dds":0.8060836501901141,"last_synced_commit":"2308c02693876d3430d22a283e55ecda8351a96a"},"previous_names":["jevakallio/redux-offline"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-offline%2Fredux-offline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-offline%2Fredux-offline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-offline%2Fredux-offline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-offline%2Fredux-offline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redux-offline","download_url":"https://codeload.github.com/redux-offline/redux-offline/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739653,"owners_count":21635892,"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":["hacktoberfest","offline-capable","react","react-native","redux"],"created_at":"2024-07-30T17:01:20.987Z","updated_at":"2025-05-05T22:47:33.216Z","avatar_url":"https://github.com/redux-offline.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg alt=\"redux-offline\" src=\"docs/static/img/redux-offline.png\" width=\"300\"\u003e\u003c/img\u003e\n\u003c/p\u003e\n\u003cp\u003e\n  \u003ca title='License' href=\"https://raw.githubusercontent.com/redux-offline/redux-offline/master/LICENSE\" height=\"18\"\u003e\n    \u003cimg src='https://img.shields.io/badge/license-MIT-blue.svg' /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://badge.fury.io/js/%40redux-offline%2Fredux-offline\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/%40redux-offline%2Fredux-offline.svg\" alt=\"npm version\" height=\"18\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/redux-offline/redux-offline\"\u003e\n    \u003cimg src=\"https://travis-ci.org/redux-offline/redux-offline.svg?branch=master\" alt=\"travis\" height=\"18\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n🚨🚨🚨🚨 **Maintainers wanted**\n\n\u003cbr\u003e\n\nPersistent Redux store for _Reasonaboutable_:tm: Offline-First applications, with first-class support for optimistic UI. Use with React, React Native, or as standalone state container for any web app.\n\n\u003e Redux Offline is now being maintained by a community driven team. The new versions of the library will now be available under the npm organization `@redux-offline`. Big thank you to [@jevakallio](https://github.com/jevakallio) for creating this amazing library in the first place.\n\n## Quick start\n\n##### 1. Install with npm (or [Yarn](https://yarnpkg.com))\n\n##### For React Native 0.60+\n```shell\nnpm install --save @redux-offline/redux-offline@native\n```\n\n#### For React Native Expo SDK 36\n```shell\nnpm install --save @redux-offline/redux-offline@expo\n```\n\n#### For React Native \u003c= 0.59\n```shell\nnpm install --save @redux-offline/redux-offline\n```\n\n##### 2. Add the `offline` [store enhancer](http://redux.js.org/docs/Glossary.html#store-enhancer) with `compose`\n```js\n\nimport { applyMiddleware, createStore, compose } from 'redux';\nimport { offline } from '@redux-offline/redux-offline';\nimport offlineConfig from '@redux-offline/redux-offline/lib/defaults';\n\n// ...\n\nconst store = createStore(\n  reducer,\n  preloadedState,\n  compose(\n    applyMiddleware(middleware),\n    offline(offlineConfig)\n  )\n);\n```\n\n##### 3. Decorate actions with offline metadata\n\n```js\nconst followUser = userId =\u003e ({\n  type: 'FOLLOW_USER_REQUEST',\n  payload: { userId },\n  meta: {\n    offline: {\n      // the network action to execute:\n      effect: { url: '/api/follow', method: 'POST', json: { userId } },\n      // action to dispatch when effect succeeds:\n      commit: { type: 'FOLLOW_USER_COMMIT', meta: { userId } },\n      // action to dispatch if network action fails permanently:\n      rollback: { type: 'FOLLOW_USER_ROLLBACK', meta: { userId } }\n    }\n  }\n});\n```\n\nIf the effect payload is something other than JSON you can pass the body and headers:\n\n```js\nconst registerUser = (name, email) =\u003e ({\n  type: 'REGISTER_USER',\n  payload: { name, email },\n  meta: {\n    offline: {\n      // the network action to execute:\n      effect: { url: '/api/register', method: 'POST', body: `name=${name}\u0026email=${email}`, headers: { 'content-type': 'application/x-www-form-urlencoded' } },\n      // action to dispatch when effect succeeds:\n      commit: { type: 'REGISTER_USER_COMMIT', meta: { name, email } },\n      // action to dispatch if network action fails permanently:\n      rollback: { type: 'REGISTER_USER_ROLLBACK', meta: { name, email } }\n    }\n  }\n});\n```\n\n##### 4. (React Native Android) Ask permission to read network status\n\nIf writing a native app for Android, you'll need to make sure to request the permission to access network state in your `AndroidManifest.xml`:\n\n```xml\n  \u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /\u003e\n```\n* * *\n\nSee [Documentation](https://redux-offline.github.io/redux-offline) for configuration options, the full API, and common recipes.\n\n## Contributing\n\nImprovements and additions welcome. For large changes, please submit a discussion issue before jumping to coding; we'd hate you to waste the effort.\n\nIf you are reporting a bug, please include code that reproduces the error. Here is a starting application on [CodeSandbox](https://codesandbox.io/s/8xml9l1r0j).\n\nIn lieu of a formal style guide, follow the included eslint rules, and use Prettier to format your code.\n\n## Miscellanea\n\n### Usage with Redux Persist v5\n\nIn case you want to use a custom [redux-persist](https://github.com/rt2zz/redux-persist) version, there is an\n[example](https://gist.github.com/jarvisluong/f14872b9c7ed00bc2afc89c4622e3b55) configuration.\n\n### Prior art\n\nRedux Offline is a distillation of patterns discovered while building apps using previously existing libraries:\n\n* Forbes Lindesay's [redux-optimist](https://github.com/ForbesLindesay/redux-optimist)\n* Zack Story's [redux-persist](https://github.com/rt2zz/redux-persist/tree/v4)\n\nWithout their work, Redux Offline wouldn't exist. If you like the ideas behind Redux Offline, but want to build your own stack from lower-level components, these are good places to start.\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredux-offline%2Fredux-offline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredux-offline%2Fredux-offline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredux-offline%2Fredux-offline/lists"}