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

Function tap

packages/db-ivm/src/operators/tap.ts:35–50  ·  view source on GitHub ↗
(f: (data: MultiSet<T>) => void)

Source from the content-addressed store, hash-verified

33 * @returns The input stream
34 */
35export function tap<T>(f: (data: MultiSet<T>) => void): PipedOperator<T, T> {
36 return (stream: IStreamBuilder<T>): IStreamBuilder<T> => {
37 const output = new StreamBuilder<T>(
38 stream.graph,
39 new DifferenceStreamWriter<T>(),
40 )
41 const operator = new TapOperator<T>(
42 stream.graph.getNextOperatorId(),
43 stream.connectReader(),
44 output.writer,
45 f,
46 )
47 stream.graph.addOperator(operator)
48 return output
49 }
50}

Callers 2

compileQueryFunction · 0.90
processJoinFunction · 0.90

Calls 3

getNextOperatorIdMethod · 0.80
connectReaderMethod · 0.80
addOperatorMethod · 0.80

Tested by

no test coverage detected