Advertisement
vsokoltsov

Untitled

Mar 18th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. handleSubmit = (event) => {
  2. event.preventDefault();
  3. const form = this.state.signInForm.fields;
  4. const params = {
  5. email: form.email.value,
  6. password: form.password.value,
  7. };
  8. this.props.onSignIn(params);
  9. }
  10.  
  11. /**
  12. * Mapping dispatched functions to component's properties
  13. * @param {Object} dispatch Application dispatch function
  14. * @return {Object} Mapped functions
  15. */
  16. const mapDispatchToProps = dispatch => ({
  17. onSignIn: user => dispatch(signIn(user)),
  18. });
  19.  
  20. /**
  21. * Mapping application state to component's properties
  22. * @param {Object} state Application state
  23. * @return {Object} Mapped properties
  24. */
  25. const mapStateToProps = state => ({
  26. signInErrors: state.authorization.signInErrors,
  27. });
  28.  
  29. export default connect(mapStateToProps, mapDispatchToProps)(SignIn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement