effect-io-ai

Package: @effect/atom-react
Module: Hooks

Hooks.useAtomRefresh

Mounts an atom and returns a callback that refreshes it in the current React registry.

When to use

Use to expose a React callback that requests a refresh for an atom without reading or writing its value.

Details

The hook uses the current RegistryContext, mounts the atom for the component lifetime, and returns a callback that calls registry.refresh.

See

Signature

declare const useAtomRefresh: <A>(atom: Atom.Atom<A>) => () => void

Source

Since v4.0.0