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

Working examples of promises #28236

Closed
karelvaculik opened this issue Jul 28, 2023 · 3 comments · Fixed by #29746
Closed

Working examples of promises #28236

karelvaculik opened this issue Jul 28, 2023 · 3 comments · Fixed by #29746
Labels
Content:JS JavaScript docs help wanted If you know something about this topic, we would love your help!

Comments

@karelvaculik
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises

What specific section or headline is this issue about?

The whole page

What information was incorrect, unhelpful, or incomplete?

Would it be possible to add more working examples into the guide about promises, please? The page shows many code snippets and talks about various features of promises, but the first real working example is in approximately the first 1/3 of the page in section "Chaining after a catch". Before that, there are many examples with doSomething and other functions / promises, but none of them work on their own.

I am aware of the initial information

Since most people are consumers of already-created promises, this guide will explain consumption of returned promises before explaining how to create them.

but as somebody going from a background without promises, I find it more difficult to go through this page than it could be IMHO. I was reading all pages of this JavaScript Guide from the start and here I feel that I need to study promises elsewhere first and then get back here to be able to "complete" the vague examples.

Or if a reader is supposed to study the reference page for Promise first, can this recommendation be added to the top of the page, please?

What did you expect to see?

I would like to see more working examples with promises, because having only non-working code or pseudo-code seems like half information when in fact we could have full information available.

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

No response

Do you have anything more you want to share?

No response

@karelvaculik karelvaculik added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jul 28, 2023
@github-actions github-actions bot added the Content:JS JavaScript docs label Jul 28, 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 Jul 28, 2023
@wbamberg
Copy link
Collaborator

FWIW there's a much more hands-on guide to promises at https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Promises.

@lyndipc
Copy link
Contributor

lyndipc commented Aug 8, 2023

I agree that the promises section mentioned by @karelvaculik is kind of unclear. Can I work on this?

@Josh-Cena
Copy link
Member

To fix this, we only need to add a basic implementation for all functions mentioned on this page doSomething, etc.

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

Successfully merging a pull request may close this issue.

5 participants