mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 08:57:26 +08:00
react-redux: add failing test for map{State|Dispatch}ToProps factories
This commit is contained in:
@@ -56,10 +56,16 @@ interface ICounterStateProps {
|
||||
interface ICounterDispatchProps {
|
||||
onIncrement: () => void
|
||||
}
|
||||
// with higher order functions
|
||||
connect<ICounterStateProps, ICounterDispatchProps, {}>(
|
||||
() => mapStateToProps,
|
||||
() => mapDispatchToProps
|
||||
)(Counter);
|
||||
// with higher order functions using parameters
|
||||
connect<ICounterStateProps, ICounterDispatchProps, {}>(
|
||||
(initialState: CounterState, ownProps: {}) => mapStateToProps,
|
||||
(dispatch: Dispatch<CounterState>, ownProps: {}) => mapDispatchToProps
|
||||
)(Counter);
|
||||
// only first argument
|
||||
connect<ICounterStateProps, {}, {}>(
|
||||
() => mapStateToProps
|
||||
|
||||
Reference in New Issue
Block a user