gaearon/redux-loop — explained in plain English
Analysis updated 2026-07-17 · repo last pushed 2016-02-04
Return both new state and a side effect (like an API fetch) from the same reducer.
Replace scattered middleware and action-creator side-effect code with a single declarative pattern.
Test reducers by checking both the resulting state and the effects they queue, without mocking.
Handle a form submission's loading state and network request in one traceable place.
| gaearon/redux-loop | 0xmukesh/docusaurus-tutorial | a15n/andrewscheuermann | |
|---|---|---|---|
| Stars | 1 | 1 | 1 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2016-02-04 | 2021-12-27 | 2015-01-11 |
| Maintenance | Dormant | Dormant | Dormant |
| Setup difficulty | easy | easy | moderate |
| Complexity | 3/5 | 2/5 | 1/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
Requires an existing Redux app, care needed to avoid effect-triggering-effect loops.
Redux Loop is a library that lets you handle side effects, like fetching data from an API or running timers, directly inside your reducer, the same function that updates your app's state. Normally in Redux, state changes and side effects are handled separately, which can make code harder to follow. Redux Loop borrows an idea from the Elm programming language to let you declare what should happen next (including async operations) right alongside your state updates, all in one place. When an action arrives, your reducer can now return not just the new state, but also a list of effects to run. For example, if a user clicks "Load Data," the reducer might update the state to show a loading spinner and also return an effect that fetches the data from the server. Once the server responds, that response becomes a new action, which flows back through the reducer again. This creates a clear, traceable sequence of what your app does, making it easier to understand and test. A developer might use Redux Loop if they're building a web app with Redux and find themselves writing a lot of side-effect code scattered across action creators or middleware. Instead of that pattern, they can keep all the logic, state changes and effects, in one familiar place: the reducer. For instance, when a form is submitted, the reducer can immediately set isSaving: true and queue up a network request, then handle the success or failure response in a subsequent reducer case. Testing becomes simpler too, because you can call a reducer with a test action and verify both the new state and the effects it plans to run, without needing to mock or actually execute those effects. The README emphasizes that Redux Loop treats effects as a natural part of what a reducer does, rather than as an exceptional or separate concern. This philosophy can make code more maintainable for teams that prefer a single, declarative view of how their app responds to user actions. The library does warn against accidentally creating loops, where one effect triggers an action that triggers the same effect again, but points out this is easier to spot and prevent than similar mistakes in other Redux patterns.
A Redux library that lets reducers declare side effects like API calls alongside state updates, in one traceable place.
Mainly JavaScript. The stack also includes JavaScript, Redux.
Dormant — no commits in 2+ years (last push 2016-02-04).
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.