{"id":13394342,"url":"https://github.com/redux-loop/redux-loop","last_synced_at":"2025-04-10T23:27:43.358Z","repository":{"id":40523763,"uuid":"49091766","full_name":"redux-loop/redux-loop","owner":"redux-loop","description":"A library that ports Elm's effect system to Redux","archived":false,"fork":false,"pushed_at":"2024-03-19T18:42:21.000Z","size":1903,"stargazers_count":1957,"open_issues_count":11,"forks_count":121,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-01T05:34:44.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://redux-loop.js.org/","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-loop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-01-05T20:46:03.000Z","updated_at":"2025-03-30T08:18:40.000Z","dependencies_parsed_at":"2024-06-18T12:27:32.419Z","dependency_job_id":"9784366b-2db2-484a-91d8-04ca9a71c871","html_url":"https://github.com/redux-loop/redux-loop","commit_stats":{"total_commits":282,"total_committers":58,"mean_commits":4.862068965517241,"dds":0.7411347517730497,"last_synced_commit":"326e850df3492e3a429a5029641c7f7540672394"},"previous_names":["raisemarketplace/redux-loop"],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-loop%2Fredux-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-loop%2Fredux-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-loop%2Fredux-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redux-loop%2Fredux-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redux-loop","download_url":"https://codeload.github.com/redux-loop/redux-loop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247185333,"owners_count":20897947,"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-07-30T17:01:16.497Z","updated_at":"2025-04-10T23:27:43.324Z","avatar_url":"https://github.com/redux-loop.png","language":"JavaScript","readme":"# \u003cimg alt='redux-loop' src='https://raw.githubusercontent.com/raisemarketplace/redux-loop/master/logo/logo.png' height='200'\u003e\n\nA port of the [Elm Architecture](https://github.com/evancz/elm-architecture-tutorial) to Redux that allows you to sequence your effects naturally and purely by returning them from your reducers.\n\n\u003e Isn't it incorrect to cause side-effects in a reducer?\n\nYes! Absolutely.\n\n\u003e Doesn't redux-loop put side-effects in the reducer?\n\nIt doesn't. The values returned from the reducer when scheduling an effect with\nredux-loop only _describe_ the effect. Calling the reducer will not cause the\neffect to run. The value returned by the reducer is just an object that the\nstore knows how to interpret when it is enhanced by redux-loop. You can safely\ncall a reducer in your tests without worrying about waiting for effects to finish\nand what they will do to your environment.\n\n\u003e What are the environment requirements for redux-loop?\n\n`redux-loop` requires polyfills for ES6 `Promise` and `Symbol` to be included if\nthe browsers you target don't natively support them.\n\n## Why use this?\n\nHaving used and followed the progression of Redux and the Elm Architecture, and\nafter trying other effect patterns for Redux, we came to the following\nconclusion:\n\n\u003e Synchronous state transitions caused by returning a new state from the reducer\n\u003e in response to an action are just one of all possible effects an action can\n\u003e have on application state.\n\nMany other methods for handling effects in Redux, especially those implemented\nwith action-creators, incorrectly teach the user that asynchronous effects are\nfundamentally different from synchronous state transitions. This separation\nencourages divergent and increasingly specific means of processing particular\ntypes effects. Instead, we should focus on making our reducers powerful enough\nto handle asynchronous effects as well as synchronous state transitions. With\n`redux-loop`, the reducer doesn't just decide what happens _*now*_ due to a\nparticular action, it decides what happens _*next*_. All of the behavior of your\napplication can be traced through one place, and that behavior can be easily broken\napart and composed back together. This is one of the most powerful features of the\n[Elm architecture](https://github.com/evancz/elm-architecture-tutorial), and with\n`redux-loop` it is a feature of Redux as well.\n\n## Installation\n\n```\nnpm install --save redux-loop\n```\n\n## Support\n\nPotential bugs, general discussion, and proposals or RFCs should be submitted\nas issues to this repo, we'll do our best to address them quickly. We use this\nlibrary as well and want it to be the best it can! For questions about using the\nlibrary, [submit questions on StackOverflow](http://stackoverflow.com/questions/ask)\nwith the [`redux-loop` tag](http://stackoverflow.com/questions/tagged/redux-loop).\n\n### Don't see a feature you want?\n\nIf you're interested in adding something to `redux-loop` but don't want to wait\nfor us to incorporate the idea you can follow these steps to get your own installable\nversion of `redux-loop` with your feature included:\n\n1. Fork the main repo here\n1. Add your feature or change\n1. Change the package `\"name\"` in package.json to be `\"@\u003cyour-npm-username\u003e/redux-loop`\n1. Commit to master and `npm publish`\n1. `npm install @\u003cyour-npm-username\u003e/redux-loop`\n\nWe are _**always**_ interested in new ideas, but sometimes we get a little busy and fall\nbehind on responding and reviewing PRs. Hopefully this process will allow you to\ncontinue making progress on your projects and also provide us with more context if and\nwhen you do decide to make a PR for your new feature or change. The best way to verify\nnew features for a library is to use them in real-world scenarios!\n\n## Contributing\n\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Multiple language translations are available at [contributor-covenant.org](https://www.contributor-covenant.org/translations.html)\n","funding_links":[],"categories":["JavaScript","目录","📦 Legacy \u0026 Inactive Projects","Utilities"],"sub_categories":["\u003ca id=\"state\"\u003e状态管理\u003c/a\u003e","Side Effects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredux-loop%2Fredux-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredux-loop%2Fredux-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredux-loop%2Fredux-loop/lists"}