Closed Davinasc closed 2 years ago
I'm not sure i understand the context for your question.
So far as avoiding stringification goes, you can always just not use the library and do: localStorage.setItem("key", "value")
directly. You will still be able to get that value out using store("key")
, because the parsing is set up to return raw strings when JSON.parse fails on the value.
Thanks 🙃 avoiding stringification is exactly what is needed. The thing is that for some reason (99.99% my fault) am not being able to use localStorage.setItem
directly, but i'll try again!
Mind if i ask what the use case for this is? Do you need to interact with some other consumer of localStorage or something?
As long as this library has been out there, no one has asked to avoid stringification before.
In our case, we got some MFEs including some old ones that need to consume it from localstorage directly. The main issue is that we don't want to touch this big monster heheh
Hello 😄 great lib! Have been using this lib for some time now and it's working wonders, now we're dealing with a scenario where setting a string value
set('value')
and it's been a bit hard to not add double quotes at both ends of the string.Is there a way to bypass JSON.stringfy on .set() or to use replace function to overwrite this behavior?
Thank you