1 | "use strict";
|
2 | var __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 | };
|
7 | var Subscriber_1 = require('rxjs/Subscriber');
|
8 | function enterZone(zone) {
|
9 | return this.lift(new EnterZoneOperator(zone));
|
10 | }
|
11 | exports.enterZone = enterZone;
|
12 | var 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 | }());
|
21 | exports.EnterZoneOperator = EnterZoneOperator;
|
22 | var 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));
|