-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.js
41 lines (41 loc) · 1.38 KB
/
store.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"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 select_1 = require('@ngrx/core/operator/select');
var Observable_1 = require('rxjs/Observable');
var Store = (function (_super) {
__extends(Store, _super);
function Store(_dispatcher, _reducer, state$) {
_super.call(this);
this._dispatcher = _dispatcher;
this._reducer = _reducer;
this.select = select_1.select.bind(this);
this.source = state$;
}
Store.prototype.lift = function (operator) {
var store = new Store(this._dispatcher, this._reducer, this);
store.operator = operator;
return store;
};
Store.prototype.replaceReducer = function (reducer) {
this._reducer.next(reducer);
};
Store.prototype.dispatch = function (action) {
this._dispatcher.next(action);
};
Store.prototype.next = function (action) {
this._dispatcher.next(action);
};
Store.prototype.error = function (err) {
this._dispatcher.error(err);
};
Store.prototype.complete = function () {
// noop
};
return Store;
}(Observable_1.Observable));
exports.Store = Store;
//# sourceMappingURL=store.js.map