@gongt/ts-stl-client
Version:
39 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const react_router_redux_1 = require("react-router-redux");
const action_1 = require("../action");
const combine_reducers_1 = require("../combine-reducers");
const virtual_store_1 = require("../virtual-store");
class routing extends virtual_store_1.VirtualStore {
constructor() {
super();
this.defaultValue = {
location: null,
};
this.reduceAny({
name: react_router_redux_1.LOCATION_CHANGE,
}, combine_reducers_1.reducerFromNative(react_router_redux_1.routerReducer));
}
reduce(Action, ...reducer) {
this.reduceAny.apply(this, arguments);
}
}
exports.routing = routing;
var RoutingMethod;
(function (RoutingMethod) {
RoutingMethod[RoutingMethod["push"] = 0] = "push";
RoutingMethod[RoutingMethod["replace"] = 1] = "replace";
RoutingMethod[RoutingMethod["go"] = 2] = "go";
RoutingMethod[RoutingMethod["goBack"] = 3] = "goBack";
RoutingMethod[RoutingMethod["goForward"] = 4] = "goForward";
})(RoutingMethod = exports.RoutingMethod || (exports.RoutingMethod = {}));
class RouteAction extends action_1.ReduxAction {
constructor(payload) {
payload.args = [payload.url];
payload.method = RoutingMethod[payload.method];
super(payload);
this.type = react_router_redux_1.CALL_HISTORY_METHOD;
}
}
exports.RouteAction = RouteAction;
//# sourceMappingURL=redux-router.store.js.map