
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@simprl/dynamic-reducer
Advanced tools
dynamicReducer - reducer for Redux in which you can add or remove child reducers
Add reducer to the store when component mount and remove reducer from the store when component unmount
For more information read this article: Put a Soul into a React-Redux Project
Example with hook useReducer :
const Container = () => {
const { dispatch, useReducer } = useStore()
useReducer('books', booksReducer)
return <button onClick={() => dispatch({ space: 'book', type: 'ADD_BOOK' })} >
add book
</button>
}
Modules 'react' and 'redux' should be installed.
Run NPM command:
npm i @simprl/dynamic-reducer
Or yarn:
yarn add @simprl/dynamic-reducer
import { createStore } from 'redux';
import { reducer as dynamicReducer } from '@simprl/dynamic-reducer';
const { reducer, addReducer } = dynamicReducer()
const store = createStore(reducer)
const exStore = {
...store,
useReducer: (name, reducer) => {
useEffect(
() => addReducer(name, reducer, store.dispatch),
[ name, reducer ]
);
},
}
If your project has static reducers, you can keep they and add the dynamic reducer to the store with static reducers:
import { createStore, combineReducers } from 'redux';
import { reducer as createDynamicReducer } from '@simprl/dynamic-reducer';
import reducer1 from './ducks/reducer1';
import reducer2 from './ducks/reducer2';
const { reducer: dynamic, addReducer } = createDynamicReducer()
const store = createStore(combineReducers({
reducer1,
reducer2,
dynamic,
}))
const exStore = {
...store,
useReducer: (name, reducer) => {
useEffect(
() => addReducer(name, reducer, store.dispatch),
[ name, reducer ]
);
},
}
You can use Provider from 'react-redux' or create your own context
const App = () => {
return <Provider store={exStore} >
<Container />
</Provider>
}
const { dispatch, useReducer } = useStore()
useReducer('books', booksReducer)
FAQs
dynamicReducer - reducer for Redux in which you can add or remove child reducers
We found that @simprl/dynamic-reducer 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.