(
mapDispatchToProps:
| MapDispatchToPropsParam<TDispatchProps, TOwnProps>
| undefined,
)
| 5 | import type { MapDispatchToPropsParam } from './selectorFactory' |
| 6 | |
| 7 | export function mapDispatchToPropsFactory<TDispatchProps, TOwnProps>( |
| 8 | mapDispatchToProps: |
| 9 | | MapDispatchToPropsParam<TDispatchProps, TOwnProps> |
| 10 | | undefined, |
| 11 | ) { |
| 12 | return mapDispatchToProps && typeof mapDispatchToProps === 'object' |
| 13 | ? wrapMapToPropsConstant((dispatch: Dispatch<Action<string>>) => |
| 14 | // @ts-ignore |
| 15 | bindActionCreators(mapDispatchToProps, dispatch), |
| 16 | ) |
| 17 | : !mapDispatchToProps |
| 18 | ? wrapMapToPropsConstant((dispatch: Dispatch<Action<string>>) => ({ |
| 19 | dispatch, |
| 20 | })) |
| 21 | : typeof mapDispatchToProps === 'function' |
| 22 | ? // @ts-ignore |
| 23 | wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') |
| 24 | : createInvalidArgFactory(mapDispatchToProps, 'mapDispatchToProps') |
| 25 | } |
no test coverage detected
searching dependent graphs…