Zustand with indexedDB #2475
Unanswered
wonkyum-kim
asked this question in
General
Replies: 1 comment 2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
First of all, thank you for creating this awesome library.
I wanted to use indexedDB with Zustand.
So I looked into using
persist
andidb-keyval
.But I thought there were a few problems.
persist
, data is serialized and stored, but inindexedDB
, I thought it was an unnecessary process.idb-keyval
to be inconvenient to use. I wanted to useindexedDB
directly.So, I wrote the code as below without using
persist
andidb-keyval
.I feel like it works well, but I don't think this code is perfect.
For example, I also had to use serialization when modifying existing data.
And I think other problems may arise that I didn't expect.
I'm curious if anyone has had the same problem as me and how they solved it!
Beta Was this translation helpful? Give feedback.
All reactions