updux/dist/buildCreateStore.js

24 lines
494 B
JavaScript
Raw Normal View History

2019-10-22 22:15:08 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = buildCreateStore;
var _redux = require("redux");
function buildCreateStore(reducer, initial, middleware, actions) {
return () => {
const store = (0, _redux.createStore)(reducer, initial, (0, _redux.applyMiddleware)(middleware));
for (let a in actions) {
store.dispatch[a] = (...args) => {
store.dispatch(actions[a](...args));
};
}
return store;
};
}
;