sc0ttj / component

A tiny library for isomorphic JavaScript components
MIT License
2 stars 1 forks source link

Feature: play/pause requestAnimationFrame() #35

Closed sc0ttj closed 3 years ago

sc0ttj commented 3 years ago

This wrapper around requestAnimationFrame makes it really easy to play and pause any animation loop:

..this could be used by Component in various ways:

NOTE: this may not be useful, and therefore not worth it - have a think about use cases..

..would be useful for an animation editor/designer app - to traverse or scrub through animations..

could have:

sc0ttj commented 3 years ago

tweenState can already do this - the tweens it returns have pause methods, and u can pause them at start by default - just document it better.. Closing.