soc221b/pinia-plugin-persistedstate-2

setItem's value isn't `any`, but `string`, because serialization happens before calling storage.setItem().

Krzysztof-Dziardziel opened this issue · 2 comments

image
In the documentation it says that value can be any, but this is not true as the serialization happens in the library code before setItem is called.
image

I was getting string as a fallback of serialize method, because it was returning console.log(state).

The serialization can be customized, e.g., you may want to store objects to IndexedDB:

image

https://github.com/iendeavor/pinia-plugin-persistedstate-2#common-options .