Skip to content

Commit

Permalink
docs: add state freezing in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerhahnekamp committed Nov 17, 2024
1 parent 57ad5c5 commit e14e53d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/ngrx.io/content/guide/signals/signal-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ patchState(

<div class="alert is-critical">

Updaters passed to the `patchState` function must perform state updates in an immutable manner.
The state is frozen during development mode. This means all changes via `patchState` must be immutable. If a mutable change occurs — whether through `patchState`, a component, a service, or any other entity with access to the state — an error will be thrown.

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const BooksStore = signalStore(

<div class="alert is-helpful">

The state of the SignalStore is updated using the `patchState` function.
The state of the SignalStore is frozen in development mode, which means any mutable change will throw an error. `patchState` is the function to update the state.
For more details on the `patchState` function, refer to the [Updating State](/guide/signals/signal-state#updating-state) guide.

</div>
Expand Down

0 comments on commit e14e53d

Please sign in to comment.