UNPKG

motion-plus-vue

Version:

Motion Plus Vue

23 lines (22 loc) 532 B
import { useSpring as a, useMotionValue as c, animate as o } from "motion-v"; import { useMixed as d } from "./use-mixed.mjs"; import { watch as l } from "vue"; function h(m, u, i) { const e = a(0, { stiffness: 600, damping: 50 }), s = c(0), p = d(m, e, s); return l( () => i == null ? void 0 : i.value, (n, f) => { n ? (!f && !s.isAnimating() ? e.jump(n) : e.set(n), o(s, u.value || 0)) : o(s, 0); }, { immediate: !0, flush: "sync" } ), p; } export { h as useSnappedValue };