Skip to main content

Interface: UseUndoableStateOptions<T>

Defined in: types.ts:601

Options for useUndoableState.

Type Parameters

Type ParameterDescription
TThe state value type.

Properties

coalesceKey?

optional coalesceKey?: string

Defined in: types.ts:609

Coalesce key applied to every command pushed by the setter. Use this to group bursts (typing, dragging) into one entry.


coalesceWindowMs?

optional coalesceWindowMs?: number

Defined in: types.ts:615

Optional per-command coalescing window override applied by the setter. See Command.coalesceWindowMs for semantics.


equals?

optional equals?: (a, b) => boolean

Defined in: types.ts:620

Equality predicate used to suppress no-op writes. Defaults to Object.is.

Parameters

ParameterType
aT
bT

Returns

boolean


label?

optional label?: string

Defined in: types.ts:603

Optional label applied to every command pushed by the setter.


scopeId?

optional scopeId?: string

Defined in: types.ts:628

Scope id to push entries into. Defaults to "default". The hook pins to this scope rather than tracking the active scope so React state stays bound to a stable history surface even when the user's focus (and the active claim) moves elsewhere.