Closed tprovick closed 5 years ago
You don't need to create a new promise by calling .then
specifically, all tweens are already promises. Use:
Promise.all([
TweenLite.to(...)
]);
Promise.all
will pass a resolve
function to gsap-then
's .then
so this should already work as is.
I can't merge this as is because it changes the return value of that .then
Sadly I didn't write any tests to verify the behavior.
You're completely right. I was trying to wrap something up and didn't think this all the way through.
I was having a problem with Promise.all and a timeline, but I'll revisit and see if it can't be solved in another way. Thanks for the response.
This was one of multiple promises I was waiting for via Promise.all, but if I created the promise by calling then() without passing in a function, it threw an error. It was relatively easy just to pass an empty function in, but I thought I would also add the check to the library so I didn't need to.
I thought if I found it useful, someone else might, so I created a PR.