thednp / kute.js

KUTE.js is a JavaScript animation engine for modern browsers.

Home Page:http://thednp.github.io/kute.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

HannesGitH opened this issue · 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

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.

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