@tempest/core
Version:
The core of the Tempest Stream Library
24 lines • 618 B
JavaScript
export class IndexSink {
constructor(index, sink) {
this.index = index;
this.sink = sink;
this.active = true;
this.value = void 0;
}
event(time, value) {
if (!this.active)
return;
this.value = value;
this.sink.event(time, { index: this.index, value: this.value });
}
error(time, err) {
this.sink.error(time, err);
}
end(time, value) {
if (!this.active)
return;
this.active = false;
this.sink.end(time, { index: this.index, value });
}
}
//# sourceMappingURL=IndexSink.js.map