Redux middleware for organizing business logic, intercepting actions, and performing async processing with declarative features.
Redux-logic is a Redux middleware designed to organize all business logic and side effects in one place. It intercepts actions to perform validations, transformations, and async processing like API calls, while providing declarative features such as cancellation, throttling, and debouncing. It solves the problem of scattered logic across action creators and reducers, keeping them focused and clean.
Redux developers building applications with complex async workflows, side effects, or business logic that requires interception, validation, or orchestration. It's ideal for teams wanting a centralized, testable approach without forcing specific coding styles.
Developers choose redux-logic for its flexibility in coding style (callbacks, promises, async/await, observables), powerful declarative features out-of-the-box, and ease of testing. It simplifies complex async patterns while maintaining separation of concerns, unlike thunks or fat action creators.
Redux middleware for organizing all your business logic. Intercept actions and perform async processing.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports callbacks, promises, async/await, and observables without forcing generators or RxJS, letting teams use familiar patterns. The README highlights this freedom in the tl;dr section.
Built-in properties like cancelType, latest, debounce, and throttle simplify complex patterns without custom code, as shown in the quick example with FETCH_POLLS logic.
Logic functions are isolated and easy to test, with utilities from redux-logic-test available, aligning with the goals of keeping business logic clean and testable.
Tracks async completion for server-side rendering without manual effort and supports dynamic loading of logic for code splitting, per the key features list.
Requires RxJS under the hood, adding significant bundle size if not already in the project, and the README notes the need to install rxjs first to avoid version conflicts.
History of breaking changes, like the deprecation of single dispatch signatures in v0.12 and mandatory RxJS@6 updates in v2.0.0, can disrupt upgrades and maintenance.
Setting up middleware and logic arrays introduces more initial complexity compared to simpler solutions like redux-thunk, especially for small teams or straightforward apps.