1 /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { Subscriber } from '../Subscriber';
4 export function every(predicate, thisArg) {
5 return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
7 var EveryOperator = /*@__PURE__*/ (function () {
8 function EveryOperator(predicate, thisArg, source) {
9 this.predicate = predicate;
10 this.thisArg = thisArg;
13 EveryOperator.prototype.call = function (observer, source) {
14 return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
18 var EverySubscriber = /*@__PURE__*/ (function (_super) {
19 tslib_1.__extends(EverySubscriber, _super);
20 function EverySubscriber(destination, predicate, thisArg, source) {
21 var _this = _super.call(this, destination) || this;
22 _this.predicate = predicate;
23 _this.thisArg = thisArg;
24 _this.source = source;
26 _this.thisArg = thisArg || _this;
29 EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
30 this.destination.next(everyValueMatch);
31 this.destination.complete();
33 EverySubscriber.prototype._next = function (value) {
36 result = this.predicate.call(this.thisArg, value, this.index++, this.source);
39 this.destination.error(err);
43 this.notifyComplete(false);
46 EverySubscriber.prototype._complete = function () {
47 this.notifyComplete(true);
49 return EverySubscriber;
51 //# sourceMappingURL=every.js.map