Skip to content

Promise.then doesn't wait #293

@OliverJAsh

Description

@OliverJAsh

i.e.:

require(['bootstraps/standard'])
    .then(() => (
        new Promise(resolve => setTimeout(() => resolve(), 500))
            .then(() => console.log('foo')))
    )
    .then(() => console.log('bar'))

bar will fire before foo.

I'm happy to cast the promise using Promise.resolve, but can this be documented?

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