tlt
tlt

Reputation: 15271

Should patchstate changes be immutable?

When doing patchState to update the signal store, should changes be immutable or does patchState handle that internally?

Upvotes: 2

Views: 39

Answers (1)

Naren Murali
Naren Murali

Reputation: 57696

From the documentation:

Signal State - Updating State

Updaters passed to the patchState function must perform state updates in an immutable manner. If a mutable change occurs to the state object, an error will be thrown in development mode.

Upvotes: 2

Related Questions