Created
June 29, 2018 14:57
-
-
Save Kelin2025/b28d90d6e9db1c92f523fe4450010ef6 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
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