npm jotai-effect 1.0.2
v1.0.2

latest releases: 2.2.1, 2.2.0, 2.1.7...
16 months ago
  • Addresses a compatibility issue with jotai@2.9.0 that caused atomEffects to lose their dependencies during recomputations.
  • Introduces a new utility helper withAtomEffect

Usage

const anAtom = atom(0)

// the effect is automatically added to the resulting atom
// setting the resulting atom is forwarded to the atom passed in
const anAtomWithEffect = withAtomEffect(anAtom, (get, set) => {
  console.log(`anAtom value is now ${get(anAtom)}`)
})
...
const [value, setValue] = useAtom(anAtomWithEffect)

Don't miss a new jotai-effect release

NewReleases is sending notifications on new releases.