
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.
use-store-path
Advanced tools
React hook for subscribe to redux store and force redraw component when specified path in the store changed
import { createStore } from 'redux';
import { Provider, useStore } from 'react-redux';
import { getUseStorePath } from 'use-store-path';
const store = createStore(reduce );
const exStore = {
...store,
useStorePath: getUseStorePath(store),
}
const App = () => {
return <Provider store={exStore} >
<Container />
</Provider>
}
const Container = () => {
const { useStorePath } = useStore()
const value1 = useStorePath([ 'path', 'to', 'value1' ])
const value2 = useStorePath([ 'path', 'to', 'value2' ])
return <Component value={value1} value2={value2} />
}
interface Value {
x: number;
y: number;
}
const Container = () => {
const { useStorePath } = useStore()
const value1 = useStorePath<Value>([ 'path', 'to', 'value1' ])
const value2 = useStorePath<Value>([ 'path', 'to', 'value2' ])
return <Component value={value1} value2={value2} />
}
import { createStore } from 'redux';
import { getUseStorePath } from 'use-store-path';
const { dispatch, getState } = createStore(reduce);
const exStore = {
...store,
useStorePath: getUseStorePath(store),
}
export const StoreContext = createContext<typeof extandedStore>(extandedStore);
export const useAppStore = () => useContext(StoreContext);
const App = () => {
return <StoreContext.Provider store={exStore} >
<Container />
</StoreContext.Provider>
}
const Container = () => {
const { useStorePath, dispatch } = useAppStore()
const value1 = useStorePath([ 'path', 'to', 'value1' ])
const value2 = useStorePath([ 'path', 'to', 'value2' ])
return <Component value={value1} value2={value2} onChange={() => dispatch(actionX())} />
}
subscribe(listener) - Function that adds a change listener. (See redux documentation)
getState() - Function that return root state. (See redux documentation)
Hook useStorePath()
path: string[] - Path to the value in the state.
Value in the selected path. If value not exists, return undefined
This library contains method getSubscribePath({ subscribe, getState }).
This function
subscribePath - Function that adds subscription into internal object by specified path For example after call:
subscribePath([], subscription1)
subscribePath(['a','b'], subscription2)
subscribePath(['a','c'], subscription3)
subscribePath(['a','c'], subscription4)
Will created rootListener:
{
subscribes: [ subscription1 ], children: {
a: { subscribes: [], children: {
b: { subscribes: [ subscription2 ] }
c: { subscribes: [ subscription3, subscription4 ] }
}}
}
}
When redux state changed, then iterate rootListener and compare previous and new state on each node.
If state of this node changed, then subscription add to the fireQueue, and recursive iterate children nodes.
Then subscriptions one by one pull from fireQueue and call.
fireQueue resolve issue when new dispatch call inside subscription.
FAQs
useStorePath - react hook for subscribe to redux path
We found that use-store-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.