0.8.9 • Published 1 year ago

@rxfx/animation v0.8.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

𝗥𝘅𝑓𝑥 animation

Create JS-driven animations without recursive requestAnimationFrame calls, and with appropriate cancelation and timeouts.

A TypeScript/Observable version TweenJS. Includes @rxfx/perception, @rxfx/after.

Example:

import { tweenToValue, LERP } from '@rxfx/animation';

const tweens = tweenToValue(
  { x: 1 },     // start
  { x: 100 },   // end
  100,          // duration
  LERP          // interpolation (default linear)
);

tweens.subscribe({
  next(frame) {
    // frame.x increases toward 100 every animationFrame
  },
});

Part of the 𝗥𝘅𝑓𝑥 family of libraries.