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

Function waitForItem

packages/db-collection-e2e/src/suites/moves.suite.ts:98–107  ·  view source on GitHub ↗
(
      collection: Collection<any, any, any, any, any>,
      itemId: string,
      timeout: number = 10000,
    )

Source from the content-addressed store, hash-verified

96
97 // Helper to wait for a specific item to appear
98 async function waitForItem(
99 collection: Collection<any, any, any, any, any>,
100 itemId: string,
101 timeout: number = 10000,
102 ) {
103 await waitFor(() => collection.has(itemId), {
104 timeout,
105 message: `Item ${itemId} did not appear in collection`,
106 })
107 }
108
109 // Helper to wait for a specific item to disappear
110 async function waitForItemRemoved(

Callers 1

runTestsForSyncModeFunction · 0.85

Calls 2

waitForFunction · 0.90
hasMethod · 0.45

Tested by

no test coverage detected