Replies: 4 comments
-
This happens because you don't merge your objects (slices). Doesn't it fail without You might want to create a minimal reproduction without |
Beta Was this translation helpful? Give feedback.
-
@wowblvck you need to be careful with namespace slices. btw, would you mind sharing us a minimal repro on stackblitz? |
Beta Was this translation helpful? Give feedback.
-
I reproduced an approximate scenario for how the store works in my application (stackblits reproduce) The first time you run it, everything will work as expected, but when the page is reloaded, the slice methods are lost. To get them to work you need to clear your local storage. @dai-shi Yes, this problem only occurs when I enable |
Beta Was this translation helpful? Give feedback.
-
Okay, I realized that I need to use deepMerge in order to implement the storage methods. Can you show how persist can be typed and also how methods can be injected if I use partialize in persist |
Beta Was this translation helpful? Give feedback.
-
I'm trying to connect persist to my repository using this design:
And it works fine until I reload the page. After reloading the page, the methods for each of the Slices disappear and an error occurs:
Uncaught TypeError: [some function] is not a function
An error occurs when calling a method on any slice from the store.
For example:
I tried to find a solution here, but alas, I could not find similar cases.
Beta Was this translation helpful? Give feedback.
All reactions