Skip to content

Promises and asynchronous functions #101

Description

@71104

They are one honking great idea!

Promises will be available as soon as #65 is fixed because the Promise class can be unmarshalled from the underlying platform normally.

So this bug is mostly about implementing the await statement. E.g.:

let timeout = fn delay ->
  new Promise fn resolve, reject ->
    setTimeout (fn _ -> resolve "hello!") delay in

console.log (await (timeout 1000))  # prints "hello!" after 1 second

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions