UNPKG

@ngrx/core

Version:

Core operators and utiliies for the ngrx platform

34 lines (33 loc) 1.24 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 enterZone(zone) { return this.lift(new EnterZoneOperator(zone)); } exports.enterZone = enterZone; var EnterZoneOperator = (function () { function EnterZoneOperator(_zone) { this._zone = _zone; } EnterZoneOperator.prototype.call = function (subscriber, source) { return source._subscribe(new EnterZoneSubscriber(subscriber, this._zone)); }; return EnterZoneOperator; }()); exports.EnterZoneOperator = EnterZoneOperator; var EnterZoneSubscriber = (function (_super) { __extends(EnterZoneSubscriber, _super); function EnterZoneSubscriber(destination, _zone) { _super.call(this, destination); this._zone = _zone; } EnterZoneSubscriber.prototype._next = function (value) { var _this = this; this._zone.run(function () { return _this.destination.next(value); }); }; return EnterZoneSubscriber; }(Subscriber_1.Subscriber));