Use MapDispatchToPropsParam in redux/pack.ts

This commit is contained in:
Jerko Steiner 2019-08-30 13:35:45 +07:00
parent 5b9f4b9321
commit 19f0993088

View File

@ -1,5 +1,5 @@
import { ComponentType, PureComponent } from 'react' import { ComponentType, PureComponent } from 'react'
import { connect, Omit } from 'react-redux' import { connect, Omit, MapDispatchToPropsParam } from 'react-redux'
import { Dispatch } from 'redux' import { Dispatch } from 'redux'
import { TStateSelector } from './TStateSelector' import { TStateSelector } from './TStateSelector'
@ -34,7 +34,7 @@ export function pack<
>( >(
getLocalState: TStateSelector<State, LocalState>, getLocalState: TStateSelector<State, LocalState>,
mapStateToProps: (state: LocalState) => StateProps, mapStateToProps: (state: LocalState) => StateProps,
mapDispatchToProps: (dispatch: Dispatch) => DispatchProps, mapDispatchToProps: MapDispatchToPropsParam<DispatchProps, Props>,
Component: React.ComponentType<Props>, Component: React.ComponentType<Props>,
): ComponentType< ): ComponentType<
Omit<Props, keyof Props & (keyof StateProps | keyof DispatchProps)> Omit<Props, keyof Props & (keyof StateProps | keyof DispatchProps)>