UNPKG

1.25 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 leaveZone(zone) {
9 return this.lift(new LeaveZoneOperator(zone));
10}
11exports.leaveZone = leaveZone;
12var LeaveZoneOperator = (function () {
13 function LeaveZoneOperator(_zone) {
14 this._zone = _zone;
15 }
16 LeaveZoneOperator.prototype.call = function (subscriber, source) {
17 return source._subscribe(new LeaveZoneSubscriber(subscriber, this._zone));
18 };
19 return LeaveZoneOperator;
20}());
21exports.LeaveZoneOperator = LeaveZoneOperator;
22var LeaveZoneSubscriber = (function (_super) {
23 __extends(LeaveZoneSubscriber, _super);
24 function LeaveZoneSubscriber(destination, _zone) {
25 _super.call(this, destination);
26 this._zone = _zone;
27 }
28 LeaveZoneSubscriber.prototype._next = function (value) {
29 var _this = this;
30 this._zone.runOutsideAngular(function () { return _this.destination.next(value); });
31 };
32 return LeaveZoneSubscriber;
33}(Subscriber_1.Subscriber));