Skip to content

Instantly share code, notes, and snippets.

@DylanVann
Last active November 6, 2017 17:31
Show Gist options
  • Select an option

  • Save DylanVann/35d8835f89272619c9aba15dc5d7ada8 to your computer and use it in GitHub Desktop.

Select an option

Save DylanVann/35d8835f89272619c9aba15dc5d7ada8 to your computer and use it in GitHub Desktop.
Redux Container Concise Example
import { connect } from 'react-redux'
import { createStructuredSelector } from 'reselect'
import MyComponent from './MyComponent'
import { getName, getEmail, onEmailChanged, onNameChanged } from './userReducer'
export default connect(
createStructuredSelector({
name: getName,
email: getEmail,
}),
{
onEmailChanged,
onNameChanged,
})(MyComponent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment