weasel API - v0.8.0
    Preparing search index...

    Interface DecayOptions<T>

    interface DecayOptions<T> {
        add: (a: T, b: T) => T;
        cancelKey?: string;
        friction?: number;
        from: T;
        magnitude: (v: T) => number;
        onDone?: () => void;
        onTick: (value: T) => void;
        scale: (v: T, k: number) => T;
        threshold?: number;
        velocity: T;
    }

    Type Parameters

    • T
    Index

    Properties

    add: (a: T, b: T) => T
    cancelKey?: string
    friction?: number

    Per-second velocity multiplier in (0, 1). Default 0.95.

    from: T
    magnitude: (v: T) => number
    onDone?: () => void
    onTick: (value: T) => void
    scale: (v: T, k: number) => T
    threshold?: number

    Velocity magnitude below which decay stops. Default 0.5.

    velocity: T