Interface Spring<T>
interface Spring<T> {
damping: number;
precision: number;
set: ((new_value: T, opts?: SpringUpdateOpts) => Promise<void>);
stiffness: number;
update: ((fn: Updater<T>, opts?: SpringUpdateOpts) => Promise<void>);
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
}
damping: number;
precision: number;
set: ((new_value: T, opts?: SpringUpdateOpts) => Promise<void>);
stiffness: number;
update: ((fn: Updater<T>, opts?: SpringUpdateOpts) => Promise<void>);
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
}
Type Parameters
Methods
subscribe
- subscribe(this, run, invalidate?): Unsubscriber
Subscribe on value changes.
Parameters
- this: void
- run: Subscriber<T>
subscription callback
Optional
invalidate: Invalidator<T>cleanup callback
Returns Unsubscriber
Readable interface for subscribing.