Skip to content

Instantly share code, notes, and snippets.

@rt2zz
Created January 2, 2018 22:32
Show Gist options
  • Save rt2zz/8fd3d4a04247fa8be49a0092c22b3e7c to your computer and use it in GitHub Desktop.
Save rt2zz/8fd3d4a04247fa8be49a0092c22b3e7c to your computer and use it in GitHub Desktop.
class A extends Component {
doSomething = async () => {
this.setState({pending: true})
try {
await doSomething()
} catch (err) {
} finally {
this.setState({pending: true})
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment