react-redux: add failing test for map{State|Dispatch}ToProps factories

This commit is contained in:
Hendrik Liebau
2017-03-15 11:16:38 +01:00
parent 1f6914b860
commit e4af32331d

View File

@@ -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