@omicrxn/mercury
Version:
Mercury is a Svelte animation library powered by Motion. It simplifies complex animations with Svelte actions, provides layout and exit animations, and integrates seamlessly with Svelte features.
16 lines (15 loc) • 477 B
JavaScript
import { handleDrag } from './drag.js';
import { handleScroll } from './scroll.js';
import { handleHover } from './hover.js';
import { handleTap } from './tap.js';
export const handleGestures = (element, params) => {
const cleanups = [
handleTap(element, params),
handleHover(element, params),
handleScroll(element, params),
handleDrag(element, params)
];
return () => {
cleanups.forEach((cleanup) => cleanup?.());
};
};