
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@sepo27/redux-di
Advanced tools
A function combineDiReducers()
handles depedency injection into reducers in tree.
combineDiReducers()
accepts reducer tree:
const reducerTree = {
foo: makePlainReducer('initial foo', (state, action) => (
action.type === 'UPDATE_ACTION' ? 'foo updated' : state
)),
bar: makeDiReducer(
'initial foo',
{foo: '@foo', fox: '@baz.fox'},
(state, action, {foo, fox}, changes: ExReducerDependenciesChanges) => {
if (changes.for('foo')) return foo;
else if (changes.for('fox')) return fox;
return state;
}
),
baz: {
fox: makeDiReducer(
'initial state',
{foo: '@foo'},
(state, action, {foo}, changes: ExReducerDependenciesChanges) => {
return changes.yes() ? foo : state;
}
)
}
};
const rootReducer = combineDiReducers(reducerTree);
makePlainReducer()
: returns reducer which handles initial statemakeDiReducer
: returns reducer which handles initial state and has dependency specification storedcombineDiReducers()
: returns a root reducer, which will traverse reducers tree and handle depedency injection.Key features:
@some.path
: absolute path from any place in tree to root state^sibling.path
: path to sibling branch^^parentSibling.path
: path to parent's sibling branchLimitations:
npm version
npm publish
FAQs
Redux reducers with dependency injection
The npm package @sepo27/redux-di receives a total of 458 weekly downloads. As such, @sepo27/redux-di popularity was classified as not popular.
We found that @sepo27/redux-di 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.