UNPKG

@tanstack/db-ivm

Version:

Incremental View Maintenance for TanStack DB based on Differential Dataflow

28 lines (27 loc) 649 B
import { LinearUnaryOperator, DifferenceStreamWriter } from "../graph.js"; import { StreamBuilder } from "../d2.js"; class NegateOperator extends LinearUnaryOperator { inner(collection) { return collection.negate(); } } function negate() { return (stream) => { const output = new StreamBuilder( stream.graph, new DifferenceStreamWriter() ); const operator = new NegateOperator( stream.graph.getNextOperatorId(), stream.connectReader(), output.writer ); stream.graph.addOperator(operator); return output; }; } export { NegateOperator, negate }; //# sourceMappingURL=negate.js.map