Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Would it be useful to add a reset function to linkedSignal (or even any WritableSignal), so you can reset the signal to its latest computation?
I often use linkedSignal for "form models" I create my signal form from. Example:
public readonly person = input<Person>();
protected readonly raw = linkedSignal<Person | undefined, Person>({
source: this.person,
computation: (person, previous) => {
const base = previous?.value ?? {
firstName: '',
lastName: '',
};
return { ...base, ...person };
},
});
protected readonly form = form(this.raw);
Adding a reset function would allow me to reset the form, which can be useful.
Proposed solution
Add a reset function to linkedSignal.
Alternatives considered
It's definitely a nice-to-have; there are plenty of ways to achieve the same without the reset function.
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Would it be useful to add a
resetfunction tolinkedSignal(or even anyWritableSignal), so you can reset the signal to its latest computation?I often use
linkedSignalfor "form models" I create my signal form from. Example:Adding a
resetfunction would allow me to reset the form, which can be useful.Proposed solution
Add a
resetfunction tolinkedSignal.Alternatives considered
It's definitely a nice-to-have; there are plenty of ways to achieve the same without the
resetfunction.