bendc / animateplus

A+ animation module for the modern web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

async/await not supported by preact-cli

vedam opened this issue · comments

Hey Benjamin,
first of all thx for this great + to my tool-lib. ;-)
As with all of my chosen libs I really appreciate the small footprint and ease of use.
I really would stick with it.

To my problem:
For my webdev I'm working with preact-cli which is currently not supporting async/await, unfortunately see #17 there.
As I understand, this is because the overhead of runtime-transform is too high.

As I dive in animateplus.js I see exactly
1 x async
1 x await

Do you think it is possible to replace these with promise-then (not for your release, just for my preact-problem). Or hopefully you can just give me a hint on how to accomplish it.
I'm really new to async/await-promises, so I didn't get it working until now by myself.

I totally understand if you say: 'not my biz', but I hope you can give me a push in the right direction.
Or you say 'forget it Dude, no way to get this working'.

++++ for animate+
thx again

btw
It's working like a charm in dev-mode. Just building with preact-cli throws errors.
But that's due to the missing async/await-support.

Hi! You can probably just remove the async keyword on line 224 and replace the lines 251-252 with:

animationTimeout
  ? delay(animationTimeout).then(() => rAF.add(animation))
  : rAF.add(animation);

Hope it helps!

YAY. You saved my day.
Thx for this.