
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
redux-action-logging
Advanced tools
Redux testing utility middleware to log actions received by a store without mocking that store.
Redux testing utility middlware to log actions received by a store without mocking that store.
npm install redux-action-logging
Add redux-action-logging to your middleware chain. You likely only want to do this in your test suite and not in production
import { createStore, applyMiddleware } from "redux"
import reducer from "./reducer"
import {
storeActionsMiddleware,
storeActions
} from "redux-action-logging"
const middlewares = [storeActionsMiddleware]
store = applyMiddleware(...middlewares)(createStore)(reducer)
// Given these actions sent to your store:
store.dispatch({ type: FOO })
store.dispatch({ type: BAR })
store.dispatch({ type: BAZ, value: 10 })
store.dispatch((dispatch, getState) => dispatch({type: QUX }))
// These return true:
storeActions.has(FOO)
storeActions.has(FOO, BAR)
storeActions.has(BAZ, BAR)
storeActions.has({ type: BAZ, value: 10 })
storeActions.has(QUX)
storeActions.has(
BAR,
{ type: BAZ, value: 10}
)
// These return false:
storeActions.has(XYZZY)
storeActions.has(FOO, XYZZY)
storeActions.has({ type: BAZ, value: 5 })
storeActions.has(
BAR,
{ type: BAZ, value: 5}
)
storeActions.actions() // returns array of all actions received by your store
storeActions.clear() // clears array
MIT
FAQs
Redux testing utility middleware to log actions received by a store without mocking that store.
We found that redux-action-logging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.