{"id":21029413,"url":"https://github.com/retreon/retreon","last_synced_at":"2025-05-15T11:31:54.018Z","repository":{"id":37049793,"uuid":"223497185","full_name":"retreon/retreon","owner":"retreon","description":"A type-safe, batteries-included redux toolkit.","archived":false,"fork":false,"pushed_at":"2023-09-10T18:25:43.000Z","size":2740,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T21:56:05.158Z","etag":null,"topics":["async-actions","framework","immer","redux","redux-actions","redux-toolkit"],"latest_commit_sha":null,"homepage":"https://retreon.github.io/","language":"TypeScript","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/retreon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-11-22T22:32:11.000Z","updated_at":"2024-07-01T07:53:29.000Z","dependencies_parsed_at":"2024-11-19T04:57:44.016Z","dependency_job_id":null,"html_url":"https://github.com/retreon/retreon","commit_stats":{"total_commits":722,"total_committers":4,"mean_commits":180.5,"dds":0.6703601108033241,"last_synced_commit":"1e2c690c870180976faf9a7f33a24f6455d3bc87"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retreon%2Fretreon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retreon%2Fretreon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retreon%2Fretreon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retreon%2Fretreon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retreon","download_url":"https://codeload.github.com/retreon/retreon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254330721,"owners_count":22053034,"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":["async-actions","framework","immer","redux","redux-actions","redux-toolkit"],"created_at":"2024-11-19T12:12:17.685Z","updated_at":"2025-05-15T11:31:53.041Z","avatar_url":"https://github.com/retreon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eretreon\u003c/h1\u003e\n  \u003cp\u003eA type-safe, batteries-included redux toolkit.\u003c/p\u003e\n\n  \u003ca href=\"https://github.com/retreon/retreon/actions?query=workflow%3ATest\"\u003e\u003cimg alt=\"Build status\" src=\"https://img.shields.io/github/workflow/status/retreon/retreon/Test/main\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/retreon/\"\u003e\u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/retreon\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=retreon\"\u003e\u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/retreon?color=teal\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## Project Status\n:no_entry: UNMAINTAINED\n\nState management is still heavily evolving in React. While I believe Retreon is one of the best ways to use Redux, the community is modernizing towards modular hook-based libraries.\n\nI would recommend exploring [Recoil](https://recoiljs.org/), [Jotai](https://jotai.org/), or any of the newer approaches.\n\n## Purpose\nRedux is a phenomenally powerful tool, and it can be a true joy to work with. But it takes time to find good tooling and develop healthy patterns.\n\nRetreon aims to provide good patterns and strong types out of the box, including tools for async actions and error handling. Retreon is [FSA compliant](https://github.com/redux-utilities/flux-standard-action#readme).\n\nHere's a taste:\n\n```typescript\n// actions.ts\nconst fetchResource = createAction.async('fetch-resource', async (id: number) =\u003e {\n  const response = await fetch(`/resources/${id}`)\n  return response.json()\n})\n```\n\n```typescript\n// reducer.ts\nconst reducer = createReducer(initialState, handleAction =\u003e [\n  // Called as soon as the action starts\n  handleAction.optimistic(fetchResource, (state, resourceId) =\u003e {\n    state.loading = true\n  }),\n\n  // Optionally, handle errors if your action fails\n  handleAction.error(fetchResource, (state, error) =\u003e {\n    state.loading = false\n  }),\n\n  // Called when the action's promise resolves, passing the payload\n  handleAction(fetchResource, (state, resource) =\u003e {\n    state.loading = false\n    state.resource = resource\n  }),\n])\n```\n\nIf you prefer to learn by example, take a gander at [the examples directory](https://github.com/retreon/retreon/tree/main/examples), or check out [TodoMVC](https://retreon.github.io/todomvc/) to see a functioning application.\n\n## Installation\nRetreon can be installed through npm.\n\n```bash\n# NPM\nnpm install retreon\n\n# Yarn\nyarn add retreon\n```\n\nRetreon depends on middleware to implement async actions and error handling. Once it's installed, register it with your redux store:\n\n```ts\n// Wherever you create your redux store...\nimport { middleware } from 'retreon'\n\ncreateStore(reducer, applyMiddleware(middleware))\n```\n\n## Documentation\nDocumentation is hosted on [the retreon website](https://retreon.archetype.foundation):\n\n- [API](https://retreon.archetype.foundation/creating-actions)\n- [Examples](https://github.com/retreon/retreon/tree/main/examples)\n\n---\n\nRetreon is inspired by [redux-actions](https://github.com/redux-utilities/redux-actions) and [immer](https://github.com/immerjs/immer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretreon%2Fretreon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretreon%2Fretreon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretreon%2Fretreon/lists"}