5 Commits

Author SHA1 Message Date
Joe Pea
34d4961044 refactor: remove requestAnimationFrame polyfill, it has been out for a long time in all browsers 2024-01-14 16:10:41 -08:00
Joe Pea
b1010e3984 update formatting 2024-01-14 16:02:56 -08:00
Joe Pea
fbdd788bf8 chore: format code to updated prettier standard 2023-04-22 21:09:08 -07:00
Joe Pea
1a81837269 chore: update examples list 2020-10-25 11:06:22 -07:00
Joe Pea
98c8064a33 breaking: add a dynamic option controls whether objects and arrays passed to Tween.to() can be dynamically modified during animation.
Adds a new `dynamic` option to the `to()` method. If set to true, objects are passed in an used directly by Tween. This allows outside code to modify values dynamically during animation (including interpolated array values). Tween will modify the initial interpolation arrays. If `dynamic` is set to false, the object passed in will be copied and will never be modified, but in this case it is not possible to modify the object values dynamically during animation.

The breaking change is that, when dynamic is false, Tween makes a non-inheriting hard copy of the object passed into `to()` instead of making an prototypal "copy" that inherits values from the original object.

The reason for this breaking change is that now things are consistent: when `dynamic` is set to `false` (the default) no object passed into `Tween.to()` will ever be modified AND those objects can never be used for dynamic updates (whereas before, objects could be dynamic, but arrays were not). Likewise, when `dynamic` is `true`, then both objects and arrays can be modified on the outside and Tween will animate based on those changes.
2020-10-24 17:23:40 -07:00