Skip to main content

Type Alias: UndoableReset<T>

UndoableReset<T> = (next?) => void

Defined in: use-undoable-state.ts:31

Reset accepted by useUndoableState. Clears the bound scope's history (past + future) and overwrites the value.

  • reset() — restore the value captured on first render and clear history.
  • reset(next) — set the value to next and clear history.
  • reset(() => next) — same as reset(next), with a lazy factory.

The reset itself is not undoable: it does not push an entry, and the surrounding scope is wiped entirely so prior entries cannot be replayed.

Type Parameters

Type Parameter
T

Parameters

ParameterType
next?T | (() => T)

Returns

void