Skip to content

Instantly share code, notes, and snippets.

@AndreiCalazans
Created November 9, 2017 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreiCalazans/87170503780fd2464d690d93d4f44f10 to your computer and use it in GitHub Desktop.
Save AndreiCalazans/87170503780fd2464d690d93d4f44f10 to your computer and use it in GitHub Desktop.
guideline for mapStateToProps + Flow
// @flow
type Props = {} & ReduxProps & ReduxState
const mapStateToProps = state => ({
user: state.user,
});
const mapDispatchToProps = dispatch => ({
actions: {
logout: () => dispatch(logout()),
},
});
type ReduxProps = ExtractReturn<typeof mapStateToProps>;
type ReduxActions = ExtractReturn<typeof mapDispatchToProps>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment