juliangarnier / anime

JavaScript animation engine
https://animejs.com
MIT License
50.42k stars 3.68k forks source link

Reset method is missing in the documentation page #736

Open xJkit opened 4 years ago

xJkit commented 4 years ago

I discovered the reset() instance method in source code as follows:

instance.reset = function() {
    const direction = instance.direction;
    instance.passThrough = false;
    instance.currentTime = 0;
    instance.progress = 0;
    instance.paused = true;
    instance.began = false;
    instance.loopBegan = false;
    instance.changeBegan = false;
    instance.completed = false;
    instance.changeCompleted = false;
    instance.reversePlayback = false;
    instance.reversed = direction === 'reverse';
    instance.remaining = instance.loop;
    children = instance.children;
    childrenLength = children.length;
    for (let i = childrenLength; i--;) instance.children[i].reset();
    if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) instance.remaining++;
    setAnimationsProgress(instance.reversed ? instance.duration : 0);
  }

However, I didn't see any information about the reset() in the documentation page: https://animejs.com/documentation/#TLcontrols

Is there any reason not to mention this function in the documentation?

Or maybe just miss it?

Thanks.