computed()
computed<
T>(fn,options?):ReadonlySignal<T>
Defined in: js-api/src/u2core/signals-core.ts:791
Create a new signal that is computed based on the values of other signals.
The returned computed signal is read-only, and its value is automatically updated when any signals accessed from within the callback function change.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | () => T | The effect callback. |
options? | SignalOptions<T> | - |
Returns
A new read-only signal.