-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can I use it with es7 async/await? #27
Comments
I haven't tried it, but I imagine babel |
As in I don't think |
Just asking, @vyorkin, did you manage to figure it out? |
I didn't try, sorry, I realized that I only need fetch in browser.
|
If you're using babeljs or something else that will transpile async/await (and likely coroutines/promises) it will work... I've used it quite a bit actually. |
Good to know, I will close this for now. |
Just a quick note, @vyorkin's original example has a mistake. It should be: let fetch = require('node-fetch');
(async () => {
try {
// request
let response = await fetch('http://localhost:8088/api/v1/hooy');
// parsing
let data = await response.json();
console.log('data: ', data);
} catch (error) {
console.log('error: ', error);
}
})(); // <--------- parenthesis should be like this. |
@F21 yeah, right, good spot! |
example:
sh session:
where
es6
alias is:The text was updated successfully, but these errors were encountered: