CollectionStatus

类型别名: CollectionStatus

ts
type CollectionStatus = "idle" | "loading" | "initialCommit" | "ready" | "error" | "cleaned-up";
type CollectionStatus = "idle" | "loading" | "initialCommit" | "ready" | "error" | "cleaned-up";

定义于: packages/db/src/types.ts:335

用于生命周期管理的 collection 状态值

示例

ts
// Check collection status
if (collection.status === "loading") {
  console.log("Collection is loading initial data")
} else if (collection.status === "ready") {
  console.log("Collection is ready for use")
}
// Check collection status
if (collection.status === "loading") {
  console.log("Collection is loading initial data")
} else if (collection.status === "ready") {
  console.log("Collection is ready for use")
}
ts
// Status transitions
// idle → loading → initialCommit → ready
// Any status can transition to → error or cleaned-up
// Status transitions
// idle → loading → initialCommit → ready
// Any status can transition to → error or cleaned-up
我们的合作伙伴
Code Rabbit
Electric
Prisma
订阅 Bytes

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

Bytes

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

订阅 Bytes

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

Bytes

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