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.
dead-simple-redux-helper
Advanced tools
$ npm install --save dead-simple-redux-helper
import { createAction, createReducer } from 'dead-simple-redux-helper';
const MY_ACTION = 'myAction';
// returns flux action creator:
const someAction = createAction(MY_ACTION);
/* returns standard flux action:
{
type: MY_ACTION,
payload: 'hello'
}
*/
const action = someAction('hello');
const MY_COMPLEX_ACTION = 'myComplexAction';
// pass property names, which will be used to create `payload` object
const complexAction = createAction(MY_COMPLEX_ACTION, ['name', 'lastName', 'age']);
/* returns
{
type: MY_COMPLEX_ACTION,
payload: {
name: 'John',
lastName: 'Smith',
age: 42
}
}
*/
const action = complexAction('John', 'Smith', 42);
/* returns
{
type: MY_COMPLEX_ACTION,
payload: {
name: 'John',
lastName: undefined,
age: undefined
}
}
*/
const action = complexAction('John');
const MY_ACTION = 'myAction';
const MY_COMPLEX_ACTION = 'myComplexAction';
const initialState = {
name: '',
lastName: '',
age: 0,
}
// returns state if action.type does not match
const myReducer = createReducer(initialState, {
// every handler has 2 params: `state = initialState`, and `action.payload`
[MY_ACTION](state, payload) {
// do something
return newState
},
// { name, lastName, age } = payload (see above)
[MY_COMPLEX_ACTION](state, payload) {
// do something
return newState
}
})
MIT
FAQs
Dead simple redux helper (actions and reducers only)
The npm package dead-simple-redux-helper receives a total of 0 weekly downloads. As such, dead-simple-redux-helper popularity was classified as not popular.
We found that dead-simple-redux-helper 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.