Skip to content

Feature: Explainer for how code submission works w/ promises/async/await #92

Open
@terichadbourne

Description

@terichadbourne

To the novice or to someone who's been using JavaScript for a while but isn't yet up-to-speed with promises and async/await, it would be helpful for us to answer these questions:

  • Why didn't I have to use await before ipfs.dag.put() in one lesson but I do in another? (The answer has to do with the fact that ipfs.dag.put() and ipfs.dag.get() are actually returning promises, which we haven't mentioned anywhere, so to oversimplify, if you are going to need to do something with that value later, you need the await.)
  • What's going on with this big run aysnc function wrapped around the code I'm writing?
  • When you tell me to return something, do I add something inside of that run function or replace return run with return myThing?

We need to decide what form this should take and where it should live. Is it a lesson within the first workshop? Is it a separate page we link to from multiple workshops?

This is essentially JavaScript info, not IPFS info, so we don't want to consume too much space with it, but we need to acknowledge that it causes a bit of confusion as the user progresses through exercises.

cc @mikeal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions