ngx-bootstrap
Version:
Native Angular Bootstrap Components
42 lines • 1.75 kB
JavaScript
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 { Observable } from 'rxjs/Observable';
import { distinctUntilChanged } from 'rxjs/operator/distinctUntilChanged';
import { map } from 'rxjs/operator/map';
var MiniStore = (function (_super) {
__extends(MiniStore, _super);
function MiniStore(_dispatcher, _reducer, state$) {
var _this = _super.call(this) || this;
_this._dispatcher = _dispatcher;
_this._reducer = _reducer;
_this.source = state$;
return _this;
}
MiniStore.prototype.select = function (pathOrMapFn) {
var mapped$ = map.call(this, pathOrMapFn);
return distinctUntilChanged.call(mapped$);
};
MiniStore.prototype.lift = function (operator) {
var store = new MiniStore(this._dispatcher, this._reducer, this);
store.operator = operator;
return store;
};
MiniStore.prototype.dispatch = function (action) { this._dispatcher.next(action); };
MiniStore.prototype.next = function (action) { this._dispatcher.next(action); };
MiniStore.prototype.error = function (err) { this._dispatcher.error(err); };
MiniStore.prototype.complete = function () { };
return MiniStore;
}(Observable));
export { MiniStore };
//# sourceMappingURL=store.class.js.map