signal, computed, watch, batch: the small reactive store every widget state uses.
import { batch, computed, signal, watch } from 'pixi-silk/signal';
Interfaces#
| Interface | Description |
|---|
| Computed | A derived signal. dispose() stops it following its sources. |
| ReadSignal | A value you can read and watch. |
| Signal | A value you can read, watch and change. |
Type Aliases#
| Type Alias | Description |
|---|
| Listener | Called with the new and the previous value. |
Functions#
| Function | Description |
|---|
| batch | Runs fn and delivers the change notifications once, after it returns, even if it throws. A signal set several times notifies once, with the value from before the batch as previous. It notifies nothing if it ends equal to that value. Batches nest. |
| computed | 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. |
| signal | Creates a signal. equals decides when a write is a change (default Object.is), so mutating an object in place and setting it again notifies nobody. Set a new object instead. |
| watch | Calls fn now and on every change of source. Returns the unsubscribe function. |