MCPcopy
hub / github.com/reduxjs/redux / bindActionCreator

Function bindActionCreator

src/bindActionCreators.ts:5–12  ·  src/bindActionCreators.ts::bindActionCreator
(
  actionCreator: ActionCreator<A>,
  dispatch: Dispatch<A>
)

Source from the content-addressed store, hash-verified

3import { kindOf } from class="st">'./utils/kindOf'
4
5function bindActionCreator<A extends Action>(
6 actionCreator: ActionCreator<A>,
7 dispatch: Dispatch<A>
8) {
9 return function (this: any, ...args: any[]) {
10 return dispatch(actionCreator.apply(this, args))
11 }
12}
13
14/**
15 * Turns an object whose values are action creators, into an object with the

Callers 1

bindActionCreatorsFunction · 0.85

Calls 1

dispatchFunction · 0.70

Tested by

no test coverage detected