createCombinedMotionValue
createCombinedMotionValue returns a MotionValue<T> whose value is recomputed from a getter
whenever one of its subscribed sources changes. You wire those sources explicitly with
subscribe(values).
import { createCombinedMotionValue, createMotionValue, createTransform } from 'motion-solidjs'
const x = createMotionValue(0)
const y = createMotionValue(0)
const { value: combined, subscribe } = createCombinedMotionValue(() => [x.get(), y.get()] as const)
subscribe([x, y])
const distance = createTransform(combined, ([cx, cy]) => Math.hypot(cx, cy))
The returned object also exposes unsubscribe() and updateValue() for custom reactivity layers.
Most code should use a higher-level helper first.
createComputedauto-tracks dependencies,createTransformmaps one value, andcreateMotionTemplateinterpolates into a string.