Skip to main content

Utils

reset

Resets the WritableState<T> to its default (initial) value.

Works with: atom, atomFamily

const reset: (state: WritableState<any>) => void;

refresh

Refreshes the ReadonlyState<T>. This can mean different things depending on whether the state is mounted:

  • Re-evaluates mounted state immediately
  • Marks unmounted state for re-evaluation the next time it's read

Works with: selector, selectorFamily

const refresh: (state: ReadonlyState<any>) => void;

See also