UNPKG

1.24 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || function (d, b) {
3 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4 function __() { this.constructor = d; }
5 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6};
7var Subscriber_1 = require('rxjs/Subscriber');
8function enterZone(zone) {
9 return this.lift(new EnterZoneOperator(zone));
10}
11exports.enterZone = enterZone;
12var EnterZoneOperator = (function () {
13 function EnterZoneOperator(_zone) {
14 this._zone = _zone;
15 }
16 EnterZoneOperator.prototype.call = function (subscriber, source) {
17 return source._subscribe(new EnterZoneSubscriber(subscriber, this._zone));
18 };
19 return EnterZoneOperator;
20}());
21exports.EnterZoneOperator = EnterZoneOperator;
22var EnterZoneSubscriber = (function (_super) {
23 __extends(EnterZoneSubscriber, _super);
24 function EnterZoneSubscriber(destination, _zone) {
25 _super.call(this, destination);
26 this._zone = _zone;
27 }
28 EnterZoneSubscriber.prototype._next = function (value) {
29 var _this = this;
30 this._zone.run(function () { return _this.destination.next(value); });
31 };
32 return EnterZoneSubscriber;
33}(Subscriber_1.Subscriber));