source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/every.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { Subscriber } from '../Subscriber';
4export function every(predicate, thisArg) {
5 return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
6}
7var EveryOperator = /*@__PURE__*/ (function () {
8 function EveryOperator(predicate, thisArg, source) {
9 this.predicate = predicate;
10 this.thisArg = thisArg;
11 this.source = source;
12 }
13 EveryOperator.prototype.call = function (observer, source) {
14 return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
15 };
16 return EveryOperator;
17}());
18var 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;
25 _this.index = 0;
26 _this.thisArg = thisArg || _this;
27 return _this;
28 }
29 EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
30 this.destination.next(everyValueMatch);
31 this.destination.complete();
32 };
33 EverySubscriber.prototype._next = function (value) {
34 var result = false;
35 try {
36 result = this.predicate.call(this.thisArg, value, this.index++, this.source);
37 }
38 catch (err) {
39 this.destination.error(err);
40 return;
41 }
42 if (!result) {
43 this.notifyComplete(false);
44 }
45 };
46 EverySubscriber.prototype._complete = function () {
47 this.notifyComplete(true);
48 };
49 return EverySubscriber;
50}(Subscriber));
51//# sourceMappingURL=every.js.map
Note: See TracBrowser for help on using the repository browser.