
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@qyu/atom-state-react
Advanced tools
React bindings for @qyu/atom-state-core
const store = atomstore_new()
const root = <AtomStoreContext.Provider value={store}>
<App />
</AtomStoreContext.Provider>
Returns Atom Store from closest context, throws if used outside of context
const App = () => {
const store = useAtomStore()
}
Returns dispatch function to run atom actions
const App = () => {
const dispatch = useAtomDispatch()
}
Get atomvalue from register or return value of selector
const atomvalue = atomvalue_new(() => 10)
const App = () => {
const value = useAtomValue(atomvalue)
return <div>
{value}
</div>
}
Same use useSignalOutput but used on atomvalue or atomselector
const atomstate = atomstate_new(() => 10)
const App = () => {
const value = useAtomOutput(atomstate)
return <div>
{value}
<button onClick={() => { store.reg(atomstate).input(store.reg(atomstate).output() + 10) }}>
Increase value
</button>
</div>
}
Same as useSignalConnect but used on atomvalue or atomselector
const atomstate = atomstate_new(() => 10)
const App = () => {
const connection = useAtomConnect(atomstate)
return <div>
{connection.value /* will be null at first render, then changed to number */}
<button onClick={() => { store.reg(atomstate).input(store.reg(atomstate).output() + 10) }}>
Increase value
</button>
</div>
}
Gets state from atom value in react's useState format
const atomstate = atomstate_new(() => 10)
const App = () => {
const [state, state_set] = useAtomState(atomstate)
return <button onClick={() => { state_set(state_old => state_old + 10) }}>
{state}
</button>
}
The same as useSignalEffect on @qyu/signal-core, but gets signal from provided selector or value
const atomstate = atomstate_new(() => 10)
const App = () => {
useAtomEffect({
target: atomstate,
config: {
emit: true
},
listener: useCallback((target: OSignal<number>) => {
console.log(target.output())
}, [])
})
}
Get child of atomfamily
const atomfamily = atomfamily_new({
key: (a: number, b: number) => `${a} ${b}`,
get: (a: number, b: number) => atomvalue_new(() => ({ a, b }))
})
const App = () => {
const child = useAtomChild({ atomfamily, params: [10, 15] })
return <div>
a: {child.a} b: {child.b}
</div>
}
Request loader
const atomloader = atomloader_new_pure({
throttler: throttler_new_immediate(),
connect: () => {
console.log("connected")
return () => {
console.log("disconnected")
}
}
})
const App = () => {
// request is optional, true by default
// if true - request loader, if not - does not
useAtomLoader({
atomloader,
params: [],
request: true
})
}
Request loader inside of OSignal
const atomloader1 = atomloader_new_pure({
throttler: throttler_new_immediate(),
connect: () => {
console.log("connected1")
return () => {
console.log("disconnected1")
}
}
})
const atomloader2 = atomloader_new_pure({
throttler: throttler_new_immediate(),
connect: () => {
console.log("connected2")
return () => {
console.log("disconnected2")
}
}
})
const atomstate = atomstate_new(() => store.reg(atomloader1))
const App = () => {
// request is optional, true by default
// if true - request loader, if not - does not
useAtomLoaderDynamic({
atomloader: atomstate,
params: [],
request: true
})
}
FAQs
Atomic Storage bindings for react
We found that @qyu/atom-state-react demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.