Function: useUnsavedGuard()
useUnsavedGuard(
opts):void
Defined in: src/lib/forms/unsavedGuard.ts:98
Register the calling surface as dirty for as long as opts.dirty is true. Re-registers when any
option changes so save/discard/label stay current. Automatically unregisters on unmount.
Parameters
opts
dirty
boolean
discard?
() => void
label
string
save?
() => void | Promise<void>
Returns
void