CollectionStatus

Type Alias: CollectionStatus

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

Defined in: packages/db/src/types.ts:335

Collection status values for lifecycle management

Examples

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
Our Partners
Electric
Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.