Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async/await example #25

Open
tkgalk opened this issue Nov 17, 2017 · 1 comment
Open

async/await example #25

tkgalk opened this issue Nov 17, 2017 · 1 comment
Projects

Comments

@tkgalk
Copy link

tkgalk commented Nov 17, 2017

Let's say we have this:

matches(x)(
  async (x, xs) => {
    const thing = await somethingElse()
    ...
  },
  (x) => {

  },
)

Will this even...?

@paulojean
Copy link
Contributor

paulojean commented Nov 18, 2017

Nop, but you can

matches(42)(
  (x = 42) => {
    return Promise.resolve(44444)
        .then(somethingElse)
        ...
  },
  (x) => {

  }
)

and await outside (eg: from the caller)

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

No branches or pull requests

3 participants