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

Method constructor

packages/db-ivm/src/operators/distinct.ts:22–31  ·  view source on GitHub ↗
(
    id: number,
    input: DifferenceStreamReader<T>,
    output: DifferenceStreamWriter<KeyValue<number, GetValue<T>>>,
    by: (value: T) => any = (value: T) => value,
  )

Source from the content-addressed store, hash-verified

20 #values: Map<Hash, Multiplicity> // keeps track of the number of times each value has been seen
21
22 constructor(
23 id: number,
24 input: DifferenceStreamReader<T>,
25 output: DifferenceStreamWriter<KeyValue<number, GetValue<T>>>,
26 by: (value: T) => any = (value: T) => value,
27 ) {
28 super(id, input, output)
29 this.#by = by
30 this.#values = new Map()
31 }
32
33 run(): void {
34 const updatedValues = new Map<Hash, [Multiplicity, T]>()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected