@morph-mapper/source / useDebouncedDraft
Function: useDebouncedDraft()
useDebouncedDraft<
T>(value,onCommit,delay?): readonly [""|T,Dispatch<SetStateAction<""|T>>]
Defined in: node-inputs/src/hooks/use-debounced-draft.ts:12
Local draft state for a controlled primitive input whose commits are debounced.
The synchronization ref prevents an upstream paste, reset, or hydration update from being overwritten by a stale local draft.
Type Parameters
T
T extends string | number
Parameters
value
T | undefined
onCommit
(next) => void
delay?
number = COMMIT_DEBOUNCE_MS
Returns
readonly ["" | T, Dispatch<SetStateAction<"" | T>>]