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

Closed
josephrocca opened this Issue Jan 2, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@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 from No documentation / support for `async` and generator methods? to No documentation / support for async/await? Jan 2, 2017

@josephrocca

This comment has been minimized.

Show comment
Hide comment
@josephrocca

josephrocca 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.

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 from No documentation / support for async/await? to No documentation / support for async/await (with riot shorthand syntax)? Jan 4, 2017

@josephrocca josephrocca referenced this issue Jan 4, 2017

Closed

ES6 template literals forward slashes issue #2167

1 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment