UNPKG

832 BJavaScriptView Raw
1import { __extends } from "tslib";
2import IterResult from './iterresult';
3/**
4 * IterResult subclass that calls a callback function on each add,
5 * and stops iterating when the callback returns false.
6 */
7var CallbackIterResult = /** @class */ (function (_super) {
8 __extends(CallbackIterResult, _super);
9 function CallbackIterResult(method, args, iterator) {
10 var _this = _super.call(this, method, args) || this;
11 _this.iterator = iterator;
12 return _this;
13 }
14 CallbackIterResult.prototype.add = function (date) {
15 if (this.iterator(date, this._result.length)) {
16 this._result.push(date);
17 return true;
18 }
19 return false;
20 };
21 return CallbackIterResult;
22}(IterResult));
23export default CallbackIterResult;
24//# sourceMappingURL=callbackiterresult.js.map
\No newline at end of file