A Redux middleware that listens for and reacts on Flux actions, allowing side-effects and async operations without thunks. Current stable version is 0.2.0, with a small set of releases. It differentiates itself by using rule-based filtering (regex or function) and action transformation before listener invocation, providing a centralized way to handle async flows while keeping reducers pure. Unlike redux-thunk, actions remain plain objects, and listeners are decoupled from action creators. Active development appears to have stalled.
npm install redux-listener-middlewareVerified import paths — ran on the pinned version, not inferred.
Shows setup of middleware, listener with rule that transforms actions before async fetch, and dispatching.
Use with redux 3.x or upgrade to alternative like redux-saga or redux-observable.
Consider using redux-saga, redux-observable, or @reduxjs/toolkit listener middleware.
Return a new object in rule transform instead of mutating: (action) => ({ ...action, payload: '...' })Plan lifecycle carefully or use middleware that supports dynamic removal.
Migrate to actively maintained alternatives.
Use: import listen from 'redux-listener-middleware'; const middleware = listen(); then middleware.createListener(...)
Run: npm install redux-listener-middleware (note: 'redux' not 'redux')
Either keep thunk middleware before listener, or ensure async dispatch returns plain objects.