useAtomCallback
docs
code:ts
const f = () => {
const readCount = useAtomCallback(
useCallback((get, set, ...args) => {
const currCount = get(countAtom)
setCount(currCount)
return currCount
}, [])
)
...
}