Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Async/await syntaxes #54

Open
vincentdchan opened this issue Mar 21, 2022 · 0 comments
Open

Async/await syntaxes #54

vincentdchan opened this issue Mar 21, 2022 · 0 comments

Comments

@vincentdchan
Copy link
Collaborator

Promise:

class Promise<T> {

  public then(cb: (t: T) => Promise<T>): Promise<T> {
    // ...
  }
 
  public catch(cb: (t: T) => Promise<T>): Promise<T> {
   // ...
  }

}

Syntaxes:

Async function:

async function foo() {
  // ...
}

Await:

async function bar() {
  const a = foo().await;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant