shelving
Version:
Toolkit for using data in JavaScript.
20 lines (19 loc) • 603 B
JavaScript
import { AbstractSequence } from "./AbstractSequence.js";
/** Async iterable that pulls values from a source async iterable. */
export class ThroughSequence extends AbstractSequence {
_source;
constructor(source) {
super();
this._source = source;
}
// Implement `AbstractSequence`
next(next) {
return this._source.next(next);
}
throw(thrown) {
return this._source.throw ? this._source.throw(thrown) : super.throw(thrown);
}
return(value) {
return this._source.return ? this._source.return(value) : super.return(value);
}
}