Skip to main content

useDocument

A hook for asynchronously working with documents.

Parameters

NameTypeOptionalDescription
dataSourceIdstringFalseThe ID of the data source
documentIdstringFalseThe ID of the document
depthnumberTrueThe maximum depth level of nested objects to resolve

Returns

A list containing the document, a boolean representing the loading state, a function to update the document, and an Error, if any.

Usage

Code example: