motion-v
Version:
<h1 align="center"> <img width="35" height="35" alt="Motion logo" src="https://github.com/user-attachments/assets/00d6d1c3-72c4-4c2f-a664-69da13182ffc" /><br />Motion for Vue</h1>
19 lines (18 loc) • 613 B
JavaScript
import { useCombineMotionValues } from "./use-combine-values.mjs";
import { collectMotionValues } from "motion-dom";
import { watchEffect } from "vue";
function useComputed(computed$1) {
collectMotionValues.current = [];
const { value, subscribe, unsubscribe, updateValue } = useCombineMotionValues(computed$1);
subscribe(collectMotionValues.current);
collectMotionValues.current = void 0;
watchEffect(() => {
unsubscribe();
collectMotionValues.current = [];
updateValue();
subscribe(collectMotionValues.current);
collectMotionValues.current = void 0;
});
return value;
}
export { useComputed };