swrv
swrv copied to clipboard
LocalStorage Improvements
We've been using the localStorage adaptor extensively for some time and it's got some rough edges, which this pull request should address. This is our patched version, we've been using it in production for over a year.
- It checks for expiration on initialisation (swrv may not have been active while an expiration occurred)
- It avoids an error if setting localStorage fails (as a fallback)
- It tries to recover from localStorage being full by deleting its own cache.
To be honest, I don't think localStorage is the best tool for this because of its limitations, but it works well enough that I've not spent any time building an alternative adaptor.
@mmulqueen I'm planning on taking a closer look at this after the Vue 2.7 PR is merged; however, that would likely require a bit of a rewrite on this PR. Is that something you'd be open to looking into?
Any review for this PR? We having the same issue.
This PR requires some refactoring with the changes in https://github.com/Kong/swrv/pull/304
If someone wants to take a look, I'm happy to review