Skip to content

UseClientDocumentResult

UseClientDocumentResult<TTableDef> = [TTableDef["Value"], StateSetters<TTableDef>, string, LiveQuery<TTableDef["Value"]>]

Defined in: packages/@livestore/react/src/useClientDocument.ts:23

Return type of useClientDocument hook.

A tuple providing React-style state access to a client-document table row:

  • [0] row: The current value (decoded according to the table schema)
  • [1] setRow: Setter function to update the document
  • [2] id: The document’s ID (resolved from SessionIdSymbol if applicable)
  • [3] query$: The underlying LiveQuery for advanced use cases

TTableDef extends State.SQLite.ClientDocumentTableDef.TraitAny

The client-document table definition type