question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Adopt await/async/fetch?

See original GitHub issue

related #19060

Howdy folks!

Hope all of your current projects are going well, Iā€™ve seen some great work come up via my twitter feed.

After a little searching through previous issues, Iā€™ve found a couple regarding async/await and have also spotted relevant sections within the code base however my searches have come up empty regarding the use of fetch. What is everyoneā€™s thoughts on some movements towards async/await/fetch?

Currently the only thing within src that uses async/await is the loaders/ObjectLoader.js Within examples thereā€™s the LDrawLoader.js ā€¦but thatā€™s about it.

Yes, yes, I can see the old functions have been wrapped in new Promiseā€™s ā€¦ but, oh I dunno, does that seem like only half the job done?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
Mugen87commented, Aug 31, 2021

Since we have already invested quite a lot of time this year in modernizing the code base, Iā€™m hesitant in doing more in that regard in the next time. Especially if no concrete problem is solved with adapting new language features.

2reactions
mrdoobcommented, Sep 8, 2021

That would change how most of the examples are structured now though. Plus it adds complexity in order to achieve the same šŸ¤·ā€ā™‚ļø

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Fetch with async/await - Dmitri Pavlutin
How to use fetch() with async/await syntax in JavaScript: fetch JSON data, handle errors, make parallel requests, cancel requests.
Read more >
Async Await to The Rescue - Medium
In line 2, await keyword before fetch means that we need to wait until the fetching process is done so we can execute...
Read more >
Fetching Remote Data With Async/Await In Recent And Older ...
Learn how to use the new async/await pattern in order to fetch remote data both in recent and in older system versions.
Read more >
Async await in Swift explained with code examples - SwiftLee
The fetch data method returns as soon as the async method is called, after which all asynchronous callbacks will happen within the closure....
Read more >
Async Await
Async functions to the rescue. async function getData() { const response = await fetch("http://newfinds.com", { method: "POST" }); return await ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found