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

Method forEach

packages/db/src/collection/index.ts:541–552  ·  view source on GitHub ↗

* Execute a callback for each entry in the collection

(
    callbackfn: (
      value: WithVirtualProps<TOutput, TKey>,
      key: TKey,
      index: number,
    ) => void,
  )

Source from the content-addressed store, hash-verified

539 * Execute a callback for each entry in the collection
540 */
541 public forEach(
542 callbackfn: (
543 value: WithVirtualProps<TOutput, TKey>,
544 key: TKey,
545 index: number,
546 ) => void,
547 ): void {
548 let index = 0
549 for (const [key, value] of this.entries()) {
550 callbackfn(value, key, index++)
551 }
552 }
553
554 /**
555 * Create a new array with the results of calling a function for each entry in the collection

Callers 14

markReadyMethod · 0.45
performCleanupMethod · 0.45
disposeMethod · 0.45
walkExpressionFunction · 0.45
extractFunction · 0.45
collectSourcesFunction · 0.45
combinedLoaderMethod · 0.45
syncFnMethod · 0.45
rangeQueryMethod · 0.45
inArrayLookupMethod · 0.45

Calls 1

entriesMethod · 0.95

Tested by

no test coverage detected