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

No documentation / support for async/await (with riot shorthand syntax)? #2195

Closed
2 of 7 tasks
josephrocca opened this issue Jan 2, 2017 · 1 comment
Closed
2 of 7 tasks

Comments

@josephrocca
Copy link

@josephrocca josephrocca commented Jan 2, 2017

After some thorough googling I'm unable to find any documentation or issues on using async methods. Since async/await has landed in chrome and firefox, shouldn't async/await be supported by the riot compiler? Is there a workaround in the mean-time? Thanks!

<my-tag>
  <h1>async test</h1>

  <script>
    async doAsyncThing() {
      await new Promise((resolve) => {setTimeout(resolve,2000)});
      console.log("done");
    }
  </script>
</my-tag>

http://plnkr.co/edit/7qUMi08fw4ZLvvFHiQ1o?p=preview

Chrome 55.0.2883.87 (64-bit)
Ubuntu 16.04
Riot v3.0.5

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@josephrocca josephrocca changed the title No documentation / support for async and generator methods? No documentation / support for async/await? Jan 2, 2017
@josephrocca
Copy link
Author

@josephrocca josephrocca commented Jan 2, 2017

Ah, this works fine:

<my-tag>
  <h1>async test</h1>

  <script>
    this.doAsyncThing = async function() {
      await new Promise((resolve) => {setTimeout(resolve,2000)});
      console.log("done");
    }
    this.doAsyncThing();
  </script>
</my-tag>

I'll leave this open for a comment from the devs about potential support of async/await in riot shorthand syntax.

@josephrocca josephrocca changed the title No documentation / support for async/await? No documentation / support for async/await (with riot shorthand syntax)? Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants