You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
523 B
24 lines
523 B
2 years ago
|
"use strict";
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports["default"] = bindActionCreators;
|
||
|
|
||
|
function bindActionCreators(actionCreators, dispatch) {
|
||
|
var boundActionCreators = {};
|
||
|
|
||
|
var _loop = function _loop(key) {
|
||
|
var actionCreator = actionCreators[key];
|
||
|
|
||
|
if (typeof actionCreator === 'function') {
|
||
|
boundActionCreators[key] = function () {
|
||
|
return dispatch(actionCreator.apply(void 0, arguments));
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
|
||
|
for (var key in actionCreators) {
|
||
|
_loop(key);
|
||
|
}
|
||
|
|
||
|
return boundActionCreators;
|
||
|
}
|