Out of Memory and large (IndexedDB) state #1773
Unanswered
MartinMouritzen
asked this question in
General
Replies: 2 comments 2 replies
-
@MartinMouritzen would you mind provide us a minimal example? I would be happy to help |
Beta Was this translation helpful? Give feedback.
2 replies
-
have the same issue, any suggestion? |
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
-
I absolutely love Zustand. I have been porting my old app from Redux, and it's so much cleaner and nicer now.
However, I am hitting a few problems, and I am wondering what the best way forward is. I am making a podcast application, and the users visit a lot of podcasts. In the old app I would use localForage (also IndexedDB) to have a cache of podcasts, where each podcast had a key. When I wanted to read the podcast data I would read that cache, and after any changes save the cache again.
With Zustand I've tried to keep all those podcasts in a state.podcastCache object with their unique identifier as key. This seems to work very nicely. However I've recently started to get Out of Memory errors. This typically happens when I update the state often (even if no new content comes in) - eg. a simple change like updating state.podcastCache[uniquid].episodes[0].playedTime = currentTime;
So I am wondering a few options:
Basically, any advice or suggestions to solve this problem is very very welcome.
Beta Was this translation helpful? Give feedback.
All reactions