跳到主要内容

useGet()

function useGet<T>(EntityType, options): RxDBResource<InstanceType<T> | undefined>;

Defined in: rxdb-react/src/hooks.ts:168

通过 ID 获取单个实体。

Type Parameters​

Type Parameter
T extends EntityType

Parameters​

ParameterTypeDescription
EntityTypeT实体类型。
optionsUseOptions<EntityStaticType<T, "getOptions">>get 查询选项或幂等 factory。

Returns​

RxDBResource<InstanceType<T> | undefined>

未找到时 value 为 undefined 的查询资源。