computedSignal
DeprecatedUse
instead. Will be removed in v1.0.0. A temporary function that simulate the
linkedSignal https://next.angular.dev/api/core/linkedSignal Used to create a computed signal that is also writable. For example when you have an input signal and you want to create a computed signal that depends on it and can be writable.
Generic types: | T R |
No documentation has been provided.
Presentation
function computedSignal (
signalRef: Signal <T> | InputSignal <T> | InputSignalWithTransform <T, unknown>,
): WritableSignal <R>;
Returns
Parameters
Name | Type | Description |
---|---|---|
signalRef |
| @param signalRef The signal to be depend on |
Overloads
Overload #1 | ||||||
---|---|---|---|---|---|---|
No documentation has been provided. | ||||||
Presentation
| ||||||
Parameters
Returns | ||||||
Example usage
|
Overload #2 | |||||||||
---|---|---|---|---|---|---|---|---|---|
No documentation has been provided. | |||||||||
Presentation
| |||||||||
Parameters
Returns |
Example usage
myInputSignal = input (1);
myComputedSignal = computedSignal (myInputSignal, (value, previousValue) => (value * 2));
...
myComputedSignal.set(10);