Last active
March 7, 2016 15:35
-
-
Save gabrielhpugliese/70efb963cf51038dd9d1 to your computer and use it in GitHub Desktop.
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
onSubmit={this.props.handleSubmit((values) => { | |
return new Promise((resolve, reject) => { | |
this.handleSubmitTest(values) | |
.then(() => resolve(), err => { | |
reject(err); | |
}); | |
} | |
})} |
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
onSubmit={this.props.handleSubmit((values) => { | |
return new Promise((resolve, reject) => { | |
const errors = this.handleSubmitTest(values); | |
// You can use lodash to see if it is empty | |
if (! isEmpty(errors)) { | |
return reject(errors); | |
} | |
return resolve(); | |
} | |
})} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment