Melon-dbMelon-db
API reference@melon-db/db-react

useRecordState

@melon-db/db-react — useRecordState

@melon-db/db-react API Reference


Function: useRecordState()

useRecordState<T>(collection, id, options?): QueryAsyncState<T | null>

Defined in: hooks.ts:399

Reactive single-record hook with loading and error state.

Type Parameters

Type ParameterDefault type
T extends Record<string, unknown>Record<string, unknown>

Parameters

ParameterType
collectionstring
idstring | number | null | undefined
options?{ enabled?: boolean; }
options.enabled?boolean

Returns

QueryAsyncState<T | null>