Skip to content

Spring

Bindings for @solid-primitives/spring.

The package also provides an extension for float setters:

open Partas.Solid.Primitives.Spring.SetterExtensions
[<Extension>]
static member inline Invoke(
    setter: Setter<float>,
    newValue: float,
    options: StringSetterOptions
    ) = ...

createSpring

let createSpring(
    initialValue: 'T when 'T :> (float | float seq | Accessor<float>),
    ?stiffness: float,
    ?damping: float
    ): Signal<'T>
ParamDesc
initialValueThe initial value of the signal.
stiffnessConfigures the physics of the spring.
dampingConfigures the physics of the spring.

A signal that moves to each new value with spring physics instead of at a steady rate. Works best for values that can be interpolated, such as numbers, Date and arrays.

createDerivedSpring

let createDerivedSpring(
    target: Accessor<'T when 'T :> (float | float seq)>,
    ?stiffness: float,
    ?damping: float
    ): Accessor<'T>

A spring that follows target, like createTween.

Edit this page