
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
redux-receive-enhancer
Advanced tools
A store enhancer for receiving a future redux action as a promise.
npm i --save redux-receive-enhancer
let { createStore, compose } = require('redux')
let receiveEnhancer = require('redux-receive-enhancer')
let store = createStore(rootReducer, compose(middleware, receiveEnhancer))
store.receive({
[actions.LOGIN_SUCCESS]: (action) => action.payload.userDetails,
[actions.LOGIN_FAILURE]: () => Promise.reject('Login failed!')
}).then(
takeUserToHomepage,
showErrorAlert
)
receive :: {type} -> Promise a b
Takes an object mapping action types to functions and returns a Promise. When an action matching one of the action types in types
is dispatched, the returned promise will resolve with the result of the corresponding function (or reject if the function returns a rejected promise).
Special Types
timeout :: (Int, a -> b)
A timeout
property can be added to types
to specify how long receive
should wait for an action. It should be an array, the first element is the time in milliseconds for the timeout, the second is optional and is a function that will be called to determine what the returned promise should resolve with (by default, it will reject the promise with Error('TIMEOUT')
).
If you find this enhancer useful, you may not be using redux correctly.
FAQs
A store enhancer for receiving a future redux action as a promise.
We found that redux-receive-enhancer 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’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.