Last active
December 21, 2018 15:46
-
-
Save jamesseanwright/22453b74c3d225e8484f1c7353f57a74 to your computer and use it in GitHub Desktop.
Roll Your Own Redux - connect Example
This file contains hidden or 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
| const mapStateToProps = ({ isFormValid, hasQuoteError, isLoadingQuote }: StateProps) => ({ | |
| isFormValid, | |
| hasQuoteError, | |
| isLoadingQuote, | |
| }); | |
| const mapDispatchToProps = (dispatch: React.Dispatch<Action>) => ({ | |
| addMessage: (message: string) => dispatch(addMessage(message)), | |
| addRonSwansonQuote: () => dispatch(addRonSwansonQuote()), | |
| }); | |
| export default connect( | |
| mapStateToProps, | |
| mapDispatchToProps, | |
| )(MessageForm); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment