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 Parameter | Default type |
|---|---|
T extends Record<string, unknown> | Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
collection | string |
id | string | number | null | undefined |
options? | { enabled?: boolean; } |
options.enabled? | boolean |
Returns
QueryAsyncState<T | null>
