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

Function trackPromise

packages/db/src/query/effect.ts:1088–1096  ·  view source on GitHub ↗

Track a promise in the in-flight set, automatically removing on settlement

(
  promise: Promise<void>,
  inFlightHandlers: Set<Promise<void>>,
)

Source from the content-addressed store, hash-verified

1086
1087/** Track a promise in the in-flight set, automatically removing on settlement */
1088function trackPromise(
1089 promise: Promise<void>,
1090 inFlightHandlers: Set<Promise<void>>,
1091): void {
1092 inFlightHandlers.add(promise)
1093 promise.finally(() => {
1094 inFlightHandlers.delete(promise)
1095 })
1096}
1097
1098/** Report an error to the onError callback or console */
1099function reportError<TRow extends object, TKey extends string | number>(

Callers 1

onBatchProcessedFunction · 0.85

Calls 2

addMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected