UseLiveQueryReturn

接口:UseLiveQueryReturn<T>

定义于:useLiveQuery.ts:35

useLiveQuery hook 的返回类型

类型参数

T extends object

属性

collection

ts
collection: ComputedRef<Collection<T, string | number, {}, StandardSchemaV1<unknown, unknown>, T>>;
collection: ComputedRef<Collection<T, string | number, {}, StandardSchemaV1<unknown, unknown>, T>>;

定义于:useLiveQuery.ts:38

底层的查询 collection 实例


数据

ts
data: ComputedRef<T[]>;
data: ComputedRef<T[]>;

定义于:useLiveQuery.ts:37

按顺序排列的查询结果的响应式数组


已清理

ts
isCleanedUp: ComputedRef<boolean>;
isCleanedUp: ComputedRef<boolean>;

定义于:useLiveQuery.ts:44

当查询已清理完毕时为 true


出错

ts
isError: ComputedRef<boolean>;
isError: ComputedRef<boolean>;

定义于:useLiveQuery.ts:43

当查询遇到错误时为 true


空闲

ts
isIdle: ComputedRef<boolean>;
isIdle: ComputedRef<boolean>;

定义于:useLiveQuery.ts:42

当查询尚未开始时为 true


加载中

ts
isLoading: ComputedRef<boolean>;
isLoading: ComputedRef<boolean>;

定义于:useLiveQuery.ts:40

在初始查询数据加载时为 true


准备就绪

ts
isReady: ComputedRef<boolean>;
isReady: ComputedRef<boolean>;

定义于:useLiveQuery.ts:41

当查询收到首次数据并准备就绪时为 true


state

ts
state: ComputedRef<Map<string | number, T>>;
state: ComputedRef<Map<string | number, T>>;

定义于:useLiveQuery.ts:36

查询结果(键 → 项)的响应式 Map


status

ts
status: ComputedRef<CollectionStatus>;
status: ComputedRef<CollectionStatus>;

定义于:useLiveQuery.ts:39

当前查询状态

我们的合作伙伴
Code Rabbit
Electric
Prisma
订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。

订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。