UNPKG

ngx-bootstrap

Version:
35 lines 1.41 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /** * @copyright ngrx */ import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { observeOn } from 'rxjs/operator/observeOn'; import { queue } from 'rxjs/scheduler/queue'; import { scan } from 'rxjs/operator/scan'; var MiniState = (function (_super) { __extends(MiniState, _super); function MiniState(_initialState, actionsDispatcher$, reducer) { var _this = _super.call(this, _initialState) || this; var actionInQueue$ = observeOn.call(actionsDispatcher$, queue); var state$ = scan.call(actionInQueue$, function (state, action) { if (!action) { return state; } return reducer(state, action); }, _initialState); state$.subscribe(function (value) { return _this.next(value); }); return _this; } return MiniState; }(BehaviorSubject)); export { MiniState }; //# sourceMappingURL=state.class.js.map