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
Miscellaneous extensions such as DevTools, local storage sync, and undo/redo are constrained due to the glitch-free effect of Signals. This issue has already been raised in:
It appears that no official mid-term solution will be provided.
Proposed Solution
The Signal Store's patchState function offers the potential for a workaround.
patchState is the sole function capable of updating the state and is fully controlled by ngrx/signals. It could track its calls and provide necessary information to any SignalStore feature that requires it.
Ideally, this functionality should be incorporated into the core (see angular/angular#53703). Implementing patchState shouldn't be too complex and could be seen as low-hanging fruit.
If there is interest, I am willing to develop a prototype.
Example
typeStateChangeCallback<State>=(prev: State,current: State,diff: Partial<State>)=>void;// Using it in a featureconstwithDevTools=(name: string,stateChangeCallback: StateChangeCallback<Record<string,unknown>>)=>{// ...}// Using it in SignalStoresignalStore(withMethods((store,stateChangeCallback)=>{// ...}),withHooks((store,stateChangeCallback)=>{// ...});)
The signalStore factory, as described in issue #4340, would work well in combination with withDevTools from the example.
Documentation page
No response
I would be willing to submit a PR to fix this issue
Yes
No
The text was updated successfully, but these errors were encountered:
Information
Problem
Miscellaneous extensions such as DevTools, local storage sync, and undo/redo are constrained due to the glitch-free effect of Signals. This issue has already been raised in:
It appears that no official mid-term solution will be provided.
Proposed Solution
The Signal Store's
patchState
function offers the potential for a workaround.patchState
is the sole function capable of updating the state and is fully controlled by ngrx/signals. It could track its calls and provide necessary information to any SignalStore feature that requires it.Ideally, this functionality should be incorporated into the core (see angular/angular#53703). Implementing
patchState
shouldn't be too complex and could be seen as low-hanging fruit.If there is interest, I am willing to develop a prototype.
Example
The
signalStore
factory, as described in issue #4340, would work well in combination withwithDevTools
from the example.Documentation page
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: