News for hackers. Stuff that matters.
Re:The Problem of Async Programming, and a Crazy Idea for So... by jmull on Monday December 10, 2018 @07:49PM (#18652473)
Yes, aOut would be a promise. It would look like this:

    async function doA() {
        ...
        return "the-result-of-a";
    }
(Which returns a promise. Assuming execution reaches that last line of my sample code, the promise will resolve to "the-result-of-a" when you "await" it.)

> ...then basically doC() would needed to be re-written to handle when it gets a promised value instead of an actual value

Well, wait a minute... it wasn't written in the first place! Let's write it though. It would look like this:

   async function doC( param ) {
       ...
       // we use "await param" where we want to
       // access the value of param. e.g.:
       const paramValue = await param;

       ...
    }
So not bad.
Re:The Problem of Async Programming, and a Crazy Idea for So... by lorean_victor on Monday December 10, 2018 @08:02PM (#18652523)
yeah really not bad at all, didn't think of that solution originally. edited the article accordingly.