ui/client/features/notes/hooks/useNoteSave
Cockpit client (features), v0.9. Source: ui/client/features/notes/hooks/useNoteSave.tsx.
Functions#
useNoteSave()#
useNoteSave(
stateRef,send): () =>Promise<boolean>
Defined in: ui/client/features/notes/hooks/useNoteSave.tsx:14
Save the open note against the rev the server last confirmed. Saves run one at a time, in order, and each one reads the latest state when it starts, so a save queued behind another never goes out with a rev the first one already moved on. Resolves true when nothing is left unsaved. A failure or a stale write resolves false and leaves the typed text in the page.
Parameters#
stateRef
MutableRefObject<ScreenState>
send
(a) => void
Returns#
() => Promise<boolean>