How to use the @popmotion/easing.createReversedEasing function in @popmotion/easing

To help you get started, we’ve selected a few @popmotion/easing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popmotion / src / animations / tween / scrubber.ts View on Github external
const scrubber = ({
  from = 0,
  to = 1,
  ease = linear,
  reverseEase = false
}): Action => {
  if (reverseEase) {
    ease = createReversedEasing(ease);
  }
  return action(
    ({ update }): ScrubberSubscription => ({
      seek: progress => update(progress)
    })
  ).pipe(
    ease,
    (v: number) => mix(from, to, v)
  );
};