跳到主要内容

useRepositoryQuery()

function useRepositoryQuery<T, TOptions, RT>(
EntityType,
method,
defaultValue,
options): RxDBResource<RT>;

Defined in: hooks.ts:35

将实体仓库的 Observable 查询转换为惰性 Angular Signal 资源。

Type Parameters

Type Parameter
T extends EntityType
TOptions
RT

Parameters

ParameterTypeDescription
EntityTypeT实体类型
methodstring仓库静态查询方法名
defaultValueRT首次订阅前的默认值
optionsUseOptions<TOptions>查询参数或返回查询参数的响应式函数

Returns

RxDBResource<RT>

查询值、错误与加载状态 signals