MCPcopy Create free account
hub / github.com/TanStack/db / waitForCollectionReady

Function waitForCollectionReady

packages/db-collection-e2e/src/utils/helpers.ts:107–115  ·  view source on GitHub ↗
(
  collection: Collection<T>,
  timeout = 5000,
)

Source from the content-addressed store, hash-verified

105 * Wait for collection to finish loading (status === 'ready')
106 */
107export async function waitForCollectionReady<T extends object>(
108 collection: Collection<T>,
109 timeout = 5000,
110): Promise<void> {
111 await waitFor(() => collection.status === `ready`, {
112 timeout,
113 message: `Collection did not reach 'ready' status (current: ${collection.status})`,
114 })
115}
116
117/**
118 * Wait for a query to have data after preload.

Callers

nothing calls this directly

Calls 1

waitForFunction · 0.70

Tested by

no test coverage detected