Skip to content

Asynchronous #14

@ForbesLindesay

Description

@ForbesLindesay

We've had the discussion and accepted that Promises/A+ promises are always asynchronous for then but what about for calls to resolve

let {promise, resolve} = defer();
console.log(1);
promise.then(() => console.log(4));
console.log(2);
resolve(null);
console.log(3);

If resolve is allowed to be synchronous, this could result in:

1
2
4
3

But if it must be asynchronous then it must result in

1
2
3
4

Because of the restrictions of Promises/A+ it can never result in

1
4
2
3

So what's it to be? Do we force asynchronous behavior?

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