Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
redux-receive-enhancer
Advanced tools
A store enhancer for receiving a future redux action as a promise.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.