* Turns an object whose values are action creators, into an object with the * same keys, but with every function wrapped into a `dispatch` call so they * may be invoked directly. This is just a convenience method, as you can call * `store.dispatch(MyActionCreators.doSomething())` yourself just fi
(actionCreators, dispatch)
| 21203 | * function. |
| 21204 | */ |
| 21205 | function bindActionCreators(actionCreators, dispatch) { |
| 21206 | if (typeof actionCreators === 'function') { |
| 21207 | return bindActionCreator(actionCreators, dispatch); |
| 21208 | } |
| 21209 | |
| 21210 | if (typeof actionCreators !== 'object' || actionCreators === null) { |
| 21211 | throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); |
| 21212 | } |
| 21213 | |
| 21214 | var keys = Object.keys(actionCreators); |
| 21215 | var boundActionCreators = {}; |
| 21216 | for (var i = 0; i < keys.length; i++) { |
| 21217 | var key = keys[i]; |
| 21218 | var actionCreator = actionCreators[key]; |
| 21219 | if (typeof actionCreator === 'function') { |
| 21220 | boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); |
| 21221 | } |
| 21222 | } |
| 21223 | return boundActionCreators; |
| 21224 | } |
| 21225 | },{}],57:[function(require,module,exports){ |
| 21226 | (function (process){ |
| 21227 | 'use strict'; |
nothing calls this directly
no test coverage detected