Replies: 1 comment
-
Putting classes in your Redux store is not recommended. They're not serialisable, meaning things like persistence and time travel debugging will not work properly. Additionally, classes tend to modify their state mutably, whereas Redux relies on state being changed immutably. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wonder if the createSlice function does or does not support classes as a CreateSliceOptions parameter. initialState.
If in the demo project we replace interface CounterState with class CounterState
then no errors are thrown when compiling typescript.
Errors occur while the application is running, but the text of the error does not make it clear whether the error is related to the use of classes.
Beta Was this translation helpful? Give feedback.
All reactions