werkbank
    Preparing search index...

    Function useAtomEffect

    • Runs a side effect whenever the atom's state changes.

      Type Parameters

      • S

        The state type.

      • R extends ReducerMap<any>

        The reducer map type.

      Parameters

      • atom: Atom<S, R>

        The atom to observe.

      • callback: (state: S) => void

        The function to call with the new state.

      Returns void