computed
import { computed } from 'pixi-silk/signal';
function computed<T>(sources: readonly ReadSignal<unknown>[], fn: () => T): Computed<T>;
Derives a signal from others: fn runs now and again whenever one of the sources changes.
Only the listed sources are followed. Call dispose() when you no longer need it.
Type Parameters#
| Type Parameter |
|---|
T |
Parameters#
| Parameter | Type |
|---|---|
sources | readonly ReadSignal<unknown>[] |
fn | () => T |
Returns#
Computed<T>