kute.js icon indicating copy to clipboard operation
kute.js copied to clipboard

[FEATURE REQUEST] functional API for chaining multiple tweens in one go

Open HannesGitH opened this issue 3 years ago • 2 comments

let combinedtween = tween
    .chain(tween2)
    .chain(tween3)
    .chain(tween4)
    .chain(tween5);

wouldn't work

instead one needs to apply the chaining 'back to front' à la

let combinedtween = tween
    .chain(tween2 
        .chain(tween3
            .chain(tween4
                .chain(tween5)
             )
        )
    );

which is kinda cumbersome

see codepen L20 (wont work) vs L22

HannesGitH avatar Sep 30 '22 09:09 HannesGitH

This "should" work, it did work last time I checked.

let combinedtween = tween
    .chain(tween2)
    .chain(tween3)
    .chain(tween4)
    .chain(tween5);

But this "should" also work:

tween.chain(tween2, tween3, tween4, tween5)

We may have to revisit this one, as my test after some time didn't work properly.

thednp avatar Oct 01 '22 03:10 thednp

the first one didnt work, but i also didnt know about the second version, which is probably even better in most cases :) thank you

HannesGitH avatar Oct 01 '22 11:10 HannesGitH