loadModules examples in the README - async/await?
See original GitHub issueTo me, the way @jwasilgeo is using loadModules
with async/await here is much more readable. Do others agree? Now that async await is pretty mainstream (sorry IE11), I’m wondering if we should switch all our examples in the README to use this style (we could still include one Promises style example just to cover all bases)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
getting fs.readme to work with async await and promisify
1 Answer 1 · You are creating a promisified function but you are using it with a callback. · I can that the...
Read more >Async/await - The Modern JavaScript Tutorial
The keyword await makes JavaScript wait until that promise settles and returns its result. Here's an example with a promise that resolves in...
Read more >async-await-utils - npm
async-await -utils. 4.0.0 • Public • Published 5 months ago. Readme · Code Beta · 21 Dependencies · 20 Dependents · 16 Versions ......
Read more >Lazy-Loading Angular Modules (Ivy and Async Await)
In this post you'll learn how to Lazy Load an Angular module. Lazy loading means that our code isn't downloaded by the browser...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should do this. It’s time.
One note that I’ve realized since I posted the original issue:
sometimes part of the “simplicity” of async/await examples is actually just because the promise-based includes error handling where the async/await example [incorrectly] leaves it out.
If we take an example from our actual README:
It would be tempting and satisfying to change it to async/await without error handling:
… but that’s not equivalent to the original promise-based example! Making it equivalent (including error catching):
… which makes it closer in complexity to the promise-based example. I would argue the async/await-example-with-try-catch example is still slightly better readability, but only marginally.