2 var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
9 return function (d, b) {
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 Object.defineProperty(exports, "__esModule", { value: true });
16 var Subscriber_1 = require("../Subscriber");
17 function every(predicate, thisArg) {
18 return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
20 exports.every = every;
21 var EveryOperator = (function () {
22 function EveryOperator(predicate, thisArg, source) {
23 this.predicate = predicate;
24 this.thisArg = thisArg;
27 EveryOperator.prototype.call = function (observer, source) {
28 return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
32 var EverySubscriber = (function (_super) {
33 __extends(EverySubscriber, _super);
34 function EverySubscriber(destination, predicate, thisArg, source) {
35 var _this = _super.call(this, destination) || this;
36 _this.predicate = predicate;
37 _this.thisArg = thisArg;
38 _this.source = source;
40 _this.thisArg = thisArg || _this;
43 EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
44 this.destination.next(everyValueMatch);
45 this.destination.complete();
47 EverySubscriber.prototype._next = function (value) {
50 result = this.predicate.call(this.thisArg, value, this.index++, this.source);
53 this.destination.error(err);
57 this.notifyComplete(false);
60 EverySubscriber.prototype._complete = function () {
61 this.notifyComplete(true);
63 return EverySubscriber;
64 }(Subscriber_1.Subscriber));
65 //# sourceMappingURL=every.js.map