Last active
June 4, 2019 22:45
-
-
Save stevenvachon/1d9eb1e57200add4e106053778f4ac8c to your computer and use it in GitHub Desktop.
Compare these
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
try { | |
const resumes = await this.getResumes(); | |
if (resumes.length > 0) { | |
this.setState({ | |
resume: await this.getResume(resumes[0]) | |
}); | |
} | |
} catch(error) { | |
console.error(error); | |
} finally { | |
this.setState({isLoading: false}); | |
} |
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
this.getResumes() | |
.then(resumes => { | |
if (resumes.length > 0) { | |
return this.getResume(resumes[0]).then(resume => this.setState({resume})); | |
} | |
}) | |
.catch(error => console.error(error)) | |
.finally(() => this.setState({isLoading: false})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment