API reference@melon-db/db-react
useRecord
@melon-db/db-react — useRecord
@melon-db/db-react API Reference
Function: useRecord()
useRecord<
T>(collection,id,options?):T|null
Defined in: hooks.ts:381
Reactive hook for a single record by primary key.
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
T | null
