{"library":"redux-timer-middleware","title":"redux-timer-middleware","description":"A simple Redux middleware to periodically dispatch actions. Version 1.0.0, no recent updates. Enables starting and stopping named timers via Redux actions, with optional payload, interval, and end-period. No dependencies beyond Redux. Lightweight compared to more complex saga/observable-based solutions.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install redux-timer-middleware"],"cli":null},"imports":["import timerMiddleware from 'redux-timer-middleware'","import { START_TIMER } from 'redux-timer-middleware'","import { STOP_TIMER } from 'redux-timer-middleware'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createStore, applyMiddleware } from 'redux';\nimport timerMiddleware, { START_TIMER, STOP_TIMER } from 'redux-timer-middleware';\n\nconst reducer = (state = {}, action) => state;\nconst store = createStore(reducer, applyMiddleware(timerMiddleware));\n\n// Start infinite timer dispatching 'TICK' every second\nstore.dispatch({\n  type: START_TIMER,\n  payload: { actionName: 'TICK', timerName: 'myTimer' }\n});\n\n// Later stop it\nstore.dispatch({\n  type: STOP_TIMER,\n  payload: { timerName: 'myTimer' }\n});","lang":"javascript","description":"Shows how to set up redux-timer-middleware, start an infinite timer, and stop it.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}