-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Add ability to cleanup expired values #29
Comments
I do not see the point for (const key of Object.keys(localStorage)) {
const vueStorageName = key.replace('your_namespace', '');
if (Vue.ls.get(vueStorageName, undefined) === undefined) {
Vue.ls.remove(vueStorageName);
}
} code not tested |
maybe we can have a let now = Date.now() // timestamp
this.$ls.keys(localStorage).map((key) => {
return this.$ls.get(key).expire < now
? this.$ls.remove(key)
: false
}) |
Ok, that's a good idea. |
Well, this requires the knowledge of keys format. Shouldn't it be encapsulated in vue-ls? |
@RobinCK any news with the |
you can do pull request, if so necessary |
np, but i dont know how 😞 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Having the ability to set expiry on values is great, but there is no cleanup methods apart from clear() which removes all local data.
Suggest there could be a cleanupExpired() function which would prune out all the expired data values.
The text was updated successfully, but these errors were encountered: