securityos/node_modules/react-redux/lib/utils/bindActionCreators.js

24 lines
523 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
"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;
}