You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would some of these APIs look like to you, ideally?
one approach would be to add an 'animationSettings' object to the Stopwatch interface. Then users can configure properties such as reversed, repeats, ease function, etc... An enum of different Easing options could also be included.
So for example if a user wanted a repeating animation with a "bounce" ease effect they may do as follows:
import{Mafs,useStopwatch,Easing}from"mafs"functionAnimatedPoint(){const{ time, start, animationSettings}=useStopwatch();React.useEffect(()=>{animationSettings={ease: Easing.bouncerepeats: true,};start();},[start]);
...
However, if repeating animations are included, this would require a definite animation length. As an example a user could configure a reversed and repeating animation of 10 seconds like so:
functionAnimatedPoint(){const{ time, start, animationSettings }=useStopwatch();React.useEffect(()=>{animationSettings={
...animationSettings,length: 10,reversed: true,repeats: true,};start();},[start]);
...
No description provided.
The text was updated successfully, but these errors were encountered: