2 ms·
If you change your computer's time while this is running you break this. If actually care about knowing where something was the previous frame, there is nothing
by charcircuit 4y ago
If you change your computer's time while this is running you break this. If actually care about knowing where something was the previous frame, there is nothing wrong with storing it.
It's ironic because the author is already storing this in the css.
- wongarsu 4y agoDate.now() should obviously be replaced by performance.now(), that would solve the clock problem. But you raise a good point that the author is storing the previous state in CSS. I guess the author's counter argument would be that they can still avoid storing the current direction.