Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
17 lines
512 B
Plaintext
17 lines
512 B
Plaintext
import type { ActionCreatorsMapObject, Dispatch } from 'redux'
|
|
|
|
export default function bindActionCreators(
|
|
actionCreators: ActionCreatorsMapObject,
|
|
dispatch: Dispatch,
|
|
): ActionCreatorsMapObject {
|
|
const boundActionCreators: ActionCreatorsMapObject = {}
|
|
|
|
for (const key in actionCreators) {
|
|
const actionCreator = actionCreators[key]
|
|
if (typeof actionCreator === 'function') {
|
|
boundActionCreators[key] = (...args) => dispatch(actionCreator(...args))
|
|
}
|
|
}
|
|
return boundActionCreators
|
|
}
|