Skip to content
This repository was archived by the owner on Jun 10, 2019. It is now read-only.
This repository was archived by the owner on Jun 10, 2019. It is now read-only.

Doesn't allow to get a final result of an async function #45

Description

@xgrommx

Hello @marten-de-vries I have some experiments with your plugin and I found it interesting, but I have some cases when I don't get that I expected. For example I should to get sum of 100, 200, 300 but I cannot to get it.

const delay = (time, value) => new Promise((resolver, rejecter) =>
    setTimeout(() => resolver(value), time)
)

const f = async (x, y, z) => {
    const a = await delay(1000, x);
    console.log(a);
    const b = await delay(2000, y);
    console.log(b);
    const c = await delay(3000, z);
    console.log(c);


    return a + b + c;
}

f(100, 200, 300).then(sum => console.log(`Sum of two arguments is ${sum}`));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions