Promise.all hangsSee original GitHub issue
Your system information
- VelocityJS version: 2.0.2
- Browser: firefox 59.0.2 64-bit chrome 66.0.3359.139 64-bit
- Operating System: Arch linux
- Is this an issue with code?: Yes
- Is this an issue with documentation?: No
- Have you reproduced this in other browsers?: only firefox and chrome, didn’t try others
- Have you checked for updates?: Using latest 2.x
- Have you checked for similar open issues?: Yes
Please remember that this is an issue tracker, support requests should be posted on StackOverflow - see CONTRIBUTING.md
Please describe your issue in as much detail as possible:
Describe what you expected should happen and what did happen.
Expected: I expected to use
Promise.all(arrayOfAnimations) without issue.
Actual: Browser freezes
Steps for reproducing this issue (code):
Here is a minimal jsfiddle for reproducing the bug
Below is the vue code I used to understand the issue a little better
[Good Animate]to see the expected behavior
[Buggy Animate]to freeze your browser
The difference between
Buggy is that Good calls
then on each animation before passing it through
Promise.all. I believe the issue has to do with the promise implementation - for some reason in 2.x the promises are really arrays which Promise.all doesn’t play well with.
- Created 5 years ago
Top GitHub Comments
Ugh, not sure exactly what can be done about this one - it’s literally impossible to have them as real Promises, but they copy the important bits across into the returns so that they can be used as Thenables.
This is going to need a bit of thought to handle - my initial one being “supply a
Velocity.all([...anims])” method that can handle passing both real Promises and Velocity results.
Any ideas would be welcome 😃
I was using 2.0.4 indeed. I created a new issue and linked a JSFiddle that reproduces the problem.