piotrwitek / react-redux-typescript-jspm-starter

Futuristic, bundle-free, development environment for building Component-Driven SPA with React, Redux and TypeScript - powered by JSPM (SystemJS & Rollup with tree-shaking)
https://piotrwitek.github.io/react-redux-typescript-jspm-starter/
MIT License
231 stars 43 forks source link

Document how to remove bindActionCreators boilerplate #32

Closed piotrwitek closed 7 years ago

piotrwitek commented 7 years ago

remove bindActionCreators boilerplate using object literal with actions instead of mapDispatchToProps function

const stateToProps = (storeState: IRootReducer) => ({ 
  currencyRates: storeState.currencyRates, 
  currencyConverter: storeState.currencyConverter 
}); 

const actionsToProps = Object.assign({}, currencyConverterActions); 

export default connect(stateToProps, actionsToProps)(CurrencyConverterContainer);