UNPKG

@ngrx/core

Version:

Core operators and utiliies for the ngrx platform

34 lines (33 loc) 1.25 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = require('rxjs/Subscriber'); function leaveZone(zone) { return this.lift(new LeaveZoneOperator(zone)); } exports.leaveZone = leaveZone; var LeaveZoneOperator = (function () { function LeaveZoneOperator(_zone) { this._zone = _zone; } LeaveZoneOperator.prototype.call = function (subscriber, source) { return source._subscribe(new LeaveZoneSubscriber(subscriber, this._zone)); }; return LeaveZoneOperator; }()); exports.LeaveZoneOperator = LeaveZoneOperator; var LeaveZoneSubscriber = (function (_super) { __extends(LeaveZoneSubscriber, _super); function LeaveZoneSubscriber(destination, _zone) { _super.call(this, destination); this._zone = _zone; } LeaveZoneSubscriber.prototype._next = function (value) { var _this = this; this._zone.runOutsideAngular(function () { return _this.destination.next(value); }); }; return LeaveZoneSubscriber; }(Subscriber_1.Subscriber));