ui/client/features/blocks/hooks/useBlocks
Cockpit client (features), next. Source: ui/client/features/blocks/hooks/useBlocks.tsx.
Functions#
useBlocks()#
useBlocks():
object
Defined in: ui/client/features/blocks/hooks/useBlocks.tsx:13
Everything the Blocks tab does: read the catalogue when it opens, and save a change to one block at a time. Saves are
chained, so two quick clicks never race on the same rev. A change shows on screen only once the server confirmed it;
a refusal keeps the old copy and says why in the server's own words. No model is called from here.
Returns#
object
load
load: () =>
Promise<void>
Returns
Promise<void>
patch
patch: (
id,change) =>Promise<void>
Parameters
id
string
change
Returns
Promise<void>
reset
reset: () =>
Promise<void>
Returns
Promise<void>
setFilter
setFilter: (
text) =>void
Parameters
text
string
Returns
void
state
state:
ScreenState