Redux toolset that enables side effects to be declared within reducers using ES6 generators while preserving purity.
Redux Side Effects is a Redux toolset that enables side effects to be declared inside reducers using ES6 generators. It solves the problem of scattering business logic across actions and reducers by keeping side effects within the reducer while maintaining purity. This approach ensures reducers remain testable, hot-reloadable, and free from impure execution.
Redux developers who want to centralize domain logic and side effects, especially those inspired by Elm's architecture or frustrated with middleware like redux-thunk scattering logic.
Developers choose Redux Side Effects because it keeps side effects declarative and testable within reducers, unlike solutions like redux-thunk that split logic. Its generator-based API is intuitive and integrates seamlessly with existing Redux setups.
Redux toolset for keeping all the side effects inside your reducers while maintaining their purity.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Reducers remain deterministic by yielding side effects declaratively, keeping business logic centralized and testable without impure execution.
Generators allow direct assertion of yielded effects and state changes via iteration, simplifying test suites without extensive mocking.
Works seamlessly with existing Redux apps via a store enhancer, ensuring no breaking changes and integration with current codebases.
Side effects are expressed using the `sideEffect` function, making them explicit and easy to reason about in reducer logic.
Supports composing reducers with `yield*`, enabling modular and scalable state logic inspired by Elm's architecture.
Only supports `function*` syntax, not arrow functions, which can be a barrier for developers used to modern ES6+ syntax.
Requires careful ordering when combining with other Redux middlewares, as noted in the FAQ, leading to potential setup headaches.
Compared to alternatives like redux-thunk or redux-saga, it has fewer users, meaning less community support and fewer resources.
Using generators introduces runtime overhead that might impact performance-sensitive applications, though often negligible.