(f: (data: MultiSet<T>) => void)
| 33 | * @returns The input stream |
| 34 | */ |
| 35 | export 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 | } |
no test coverage detected