MCPcopy Index your code
hub / github.com/TanStack/db / sendChangesToD2

Method sendChangesToD2

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

* Send changes to the D2 input for the given alias. * Returns the number of multiset entries sent.

(
    alias: string,
    changes: Array<ChangeMessage<any, string | number>>,
  )

Source from the content-addressed store, hash-verified

703 * Returns the number of multiset entries sent.
704 */
705 private sendChangesToD2(
706 alias: string,
707 changes: Array<ChangeMessage<any, string | number>>,
708 ): number {
709 if (this.disposed || !this.inputs || !this.graph) return 0
710
711 const input = this.inputs[alias]
712 if (!input) return 0
713
714 // Filter duplicates per alias
715 const sentKeys = this.sentToD2KeysByAlias.get(alias)!
716 const filtered = filterDuplicateInserts(changes, sentKeys)
717
718 return sendChangesToInput(input, filtered)
719 }
720
721 /**
722 * Run the D2 graph until quiescence, then emit accumulated events once.

Callers 2

startMethod · 0.95
handleSourceChangesMethod · 0.95

Calls 3

filterDuplicateInsertsFunction · 0.85
sendChangesToInputFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected