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

Function wrappedMarkReady

packages/electric-db-collection/src/electric.ts:1355–1371  ·  view source on GitHub ↗
(isBuffering: boolean)

Source from the content-addressed store, hash-verified

1353 // Wrap markReady to wait for test hook in progressive mode
1354 let progressiveReadyGate: Promise<void> | null = null
1355 const wrappedMarkReady = (isBuffering: boolean) => {
1356 // Only create gate if we're in buffering phase (first up-to-date)
1357 if (
1358 isBuffering &&
1359 syncMode === `progressive` &&
1360 testHooks?.beforeMarkingReady
1361 ) {
1362 // Create a new gate promise for this sync cycle
1363 progressiveReadyGate = testHooks.beforeMarkingReady()
1364 progressiveReadyGate.then(() => {
1365 markReady()
1366 })
1367 } else {
1368 // No hook, not buffering, or already past first up-to-date
1369 markReady()
1370 }
1371 }
1372
1373 // Abort controller for the stream - wraps the signal if provided
1374 const abortController = new AbortController()

Callers 1

createElectricSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected