Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
timerMiddleware
✓ import timerMiddleware from 'redux-timer-middleware'
✗ import { timerMiddleware } from 'redux-timer-middleware'
Default export, not named.
START_TIMER
✓ import { START_TIMER } from 'redux-timer-middleware'
✗ import START_TIMER from 'redux-timer-middleware'
Named export for action type constant.
STOP_TIMER
✓ import { STOP_TIMER } from 'redux-timer-middleware'
✗ import STOP_TIMER from 'redux-timer-middleware'
Named export for action type constant.
Shows how to set up redux-timer-middleware, start an infinite timer, and stop it.
import { createStore, applyMiddleware } from 'redux';
import timerMiddleware, { START_TIMER, STOP_TIMER } from 'redux-timer-middleware';
const reducer = (state = {}, action) => state;
const store = createStore(reducer, applyMiddleware(timerMiddleware));
// Start infinite timer dispatching 'TICK' every second
store.dispatch({
type: START_TIMER,
payload: { actionName: 'TICK', timerName: 'myTimer' }
});
// Later stop it
store.dispatch({
type: STOP_TIMER,
payload: { timerName: 'myTimer' }
});
Errors
Common errors & fixes
Uncaught TypeError: Cannot read properties of undefined (reading 'apply')
timerMiddleware is a function, but must be applied with applyMiddleware correctly.
fiximport { createStore, applyMiddleware } from 'redux'; createStore(reducer, applyMiddleware(timerMiddleware)); TypeError: actionName is not a string
Missing or non-string actionName in START_TIMER payload.
fixEnsure payload.actionName is a string like 'MY_ACTION'.
Uncaught ReferenceError: START_TIMER is not defined
Using named import incorrectly or forgetting to import constants.
fiximport { START_TIMER } from 'redux-timer-middleware'; Audit
Dependencies
reduxrequiredPeer dependency, middleware works with Redux store