Line

ui/client/features/notes/hooks/useAutosave

Cockpit client (features), v0.9. Source: ui/client/features/notes/hooks/useAutosave.tsx.

Functions#

useAutosave()#

useAutosave(state, save): void

Defined in: ui/client/features/notes/hooks/useAutosave.tsx:12

Autosave: 800 ms after the last keystroke. The text is never blocked; a failed save or a stale write waits for a person (Retry, Keep mine, Load theirs) rather than retrying in a loop. Also warns before the tab closes while anything is unsaved, since that text lives only in the page.

Parameters#

state

ScreenState

save

() => Promise<boolean>

Returns#

void