Skip to content

Instantly share code, notes, and snippets.

@Kelin2025
Created June 29, 2018 14:57
Show Gist options
  • Save Kelin2025/b28d90d6e9db1c92f523fe4450010ef6 to your computer and use it in GitHub Desktop.
Save Kelin2025/b28d90d6e9db1c92f523fe4450010ef6 to your computer and use it in GitHub Desktop.
import nocatch from 'async-nocatch'
const myFetch = nocatch(fetch)
const { success, result } = await myFetch('http://api.github.com/users')
if (success) {
console.log('Done', result)
} else {
console.log('Fail', result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment