useMotion
function useMotion<T>(
scope: Fusion.Scope,
initialValue: T & Ripple.MotionGoal
): (Fusion.StateObject<T>, Ripple.Motion<T>)
Returns a state object following a Ripple Motion along with the Motion itself.
Parameters
scope : Fusion.Scope
The scope to store cleanup tasks.
initialValue : T & Ripple.MotionGoal
The initial value of the motor.
Returns -> (Fusion.StateObject<T>, Ripple.Motion<T>)
A state object following a Ripple Motion along with the Motion itself.
Example Usage
-- TODO: write example