You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consta=signal(2);// The state is based on another signal (linked)conststate=linkedSignalState(()=>({value: a()+1}));// orconststate=linkedSignalState({source: a,computation: (source)=>({value: source+1})});patchState(state,{value: 5});// Patch state like any other stateconsole.log(state.value());// Deep signal
Thank you, @Harpush. Rest assured, we are fully aware of the need for this and are actively discussing various strategies to address it. There are also multiple scenarios where linkedSignal could come into play, and we’re taking those into consideration.
We’re not rushing this—our goal is to ensure we get it right the first time. 😊
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
Currently signal state is a strong utility to handle state even outside signal store.
The missing part is allowing that state to be a linked signal.
I propose a new
linkedSignalState
which will allow deriving the state based on another signal.This will allow resetting the state on signal change - or any other state transformation based on some other signal change.
Describe any alternatives/workarounds you're currently using
Currently either don't use signal state or use an effect to update the state.
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: