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

Method forEach

packages/db/src/collection/state.ts:443–450  ·  view source on GitHub ↗

* Execute a callback for each entry in the collection

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

Source from the content-addressed store, hash-verified

441 * Execute a callback for each entry in the collection
442 */
443 public forEach(
444 callbackfn: (value: TOutput, key: TKey, index: number) => void,
445 ): void {
446 let index = 0
447 for (const [key, value] of this.entries()) {
448 callbackfn(value, key, index++)
449 }
450 }
451
452 /**
453 * Create a new array with the results of calling a function for each entry in the collection

Callers

nothing calls this directly

Calls 1

entriesMethod · 0.95

Tested by

no test coverage detected