Created
November 9, 2017 16:39
-
-
Save AndreiCalazans/87170503780fd2464d690d93d4f44f10 to your computer and use it in GitHub Desktop.
guideline for mapStateToProps + Flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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