Skip to content
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

Using fetch: Mixing await/async and .then/.finally syntax #24982

Open
theking2 opened this issue Mar 1, 2023 · 1 comment
Open

Using fetch: Mixing await/async and .then/.finally syntax #24982

theking2 opened this issue Mar 1, 2023 · 1 comment
Labels
area: Fetch/XMLHttpRequest Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@theking2
Copy link

theking2 commented Mar 1, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

The page starts of with a basic Promis .then/.finally syntax and then without warning shows the async/await method of fetch. I suggest
Remove the .then basic sample as it confuses the following examples and replace it with async/await basic sample.

Also the examples are getting quit specific for a page that give an overview.

I could also image a basic fetch() page that explains the two syntaxes and juxtaposition to XMLHttpRequest and than on another detailed page show simple, multiple files, CORS and other examples.

What did you expect to see?

A succinct illustration of fetch

Do you have any supporting links, references, or citations?

https://www.smashingmagazine.com/2020/11/comparison-async-await-versus-then-catch/

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@theking2 theking2 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Mar 1, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Mar 1, 2023
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Mar 3, 2023
@Josh-Cena Josh-Cena changed the title Mixing await/async and .then/.finally syntax Using fetch: Mixing await/async and .then/.finally syntax Jun 26, 2023
@wbamberg
Copy link
Collaborator

Looks like the main part of this (conversion to async/await) got done in #25819.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Fetch/XMLHttpRequest Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

5 participants
@sideshowbarker @wbamberg @theking2 @Josh-Cena and others