Closed KrosFire closed 2 years ago
Thank you, sorry for the delay, tests failing on expect(storage1.value).toMatchObject(storage2.value);
I believe I've fixed tests. It was just typescript screaming about possible undefined.
@pikax Could you run pipeline once again?
@pikax I think test failed regardless of my changes and just needs a rerun
https://pikax.me/vue-composable/composable/storage/localStorage.html
In current documentation,
remove
function is described as an equivalent tostorage.value = undefined
, but it's false. When we set starage.value = undefined, this undefined is being stored in localStorage as 'undefined' (string), which lead to issues when reloading the app.Another issue is when we pass a
ref
as adefaultValue
(which is acceptable), then theref
itself (object) is saved into localStorage, rather that it's value.There's also a thing that is missing for me personally and that is instant save into storage. Debounce is great but when I tried to use your library to store accessToken in localStorage I had an issue. In some requests the key was missing, so I believe that an option to fully sync storage with ref would be nice.
I also don't see any reason to provide
setSync
function in sessionStorage, when it's useless.I've fixed those and few other things in this pull req