Use async/await in samples#193
Use async/await in samples#193JustinBeckwith merged 1 commit intogoogleapis:masterfrom JustinBeckwith:asyncy
Conversation
|
At this point it makes sense for the samples to assume async/await support. Node 6 will be EOL in April. It is declining in usage (see https://nodejs.org/metrics) and already Node 8 seems be getting 3x the downloads as Node 6. |
|
Yeah, I think we can start with |
|
@fhinkel what are your thoughts on the way I eliminated the error handling? We used to console.log the errors, now I am just letting the async method throw. Is this the pattern we want to roll with for our samples? |
|
Looks good. You'd still see the error message in the stack trace, right? Maybe add one example that uses the |
|
So anyone willing to approve it then? 🤣 |
tswast
left a comment
There was a problem hiding this comment.
Pretty!
(Not that my approval counts in nodejs-land)
|
🤷♂️ I'll take it |
| .catch(err => { | ||
| console.error('ERROR:', err); | ||
| }); | ||
| const [rows] = await bigquery.query(options); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Mostly doing this to start a conversation :) What do y'all think of using async/await in our samples? I figure, we tell people to start with the latest LTS version of nodejs, which is 8 at this stage 🤷♂️ Node.js 6 is 6 months from death, so I don't feel too bad doing this just in the samples.
Thoughts?
@googleapis/node-team @fhinkel @ace-n