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

Function waitForReady

packages/db-collection-e2e/src/suites/moves.suite.ts:82–95  ·  view source on GitHub ↗
(
      collection: Collection<any, any, any, any, any>,
      syncMode: SyncMode,
    )

Source from the content-addressed store, hash-verified

80
81 // Helper to wait for collection to be ready
82 async function waitForReady(
83 collection: Collection<any, any, any, any, any>,
84 syncMode: SyncMode,
85 ) {
86 if (syncMode === 'progressive') {
87 // For progressive mode, start sync explicitly
88 collection.startSyncImmediate()
89 }
90 await collection.preload()
91 await waitFor(() => collection.status === `ready`, {
92 timeout: 30000,
93 message: `Collection did not become ready`,
94 })
95 }
96
97 // Helper to wait for a specific item to appear
98 async function waitForItem(

Callers 1

runTestsForSyncModeFunction · 0.85

Calls 3

waitForFunction · 0.90
startSyncImmediateMethod · 0.80
preloadMethod · 0.45

Tested by

no test coverage detected