universal-storage-module icon indicating copy to clipboard operation
universal-storage-module copied to clipboard

Feature: Expiry

Open Jamiewarb opened this issue 5 years ago • 3 comments

I'm wondering if you or other users would consider an expiration feature useful?

For example, it could work similar to how cookies expire, setting an expiry length that is set on the cookie, and also replicated to Vuex and localStorage, so a value that's expired is deleted when the app loads.

Happy to write the code for the feature if we think it would be a useful addition, and can discuss how it should work. Right now I'm rolling it myself via a decorator.

Jamiewarb avatar May 29 '20 09:05 Jamiewarb

Our team (7 of us ) would really love to have this feature.

ProsperChiduku avatar Aug 18 '20 04:08 ProsperChiduku

Sorry for the late reply. I would love it if either of you opened a PR for this feature @Jamiewarb @ProsperChiduku

farzadso avatar Aug 24 '20 05:08 farzadso

I thin it would be nice, it could be as 3rd argument:

$storage.setUniversal('token', token, { ttl: 60 })

The issue is mostly to remove it from the state automatically that makes it tricky.

atinux avatar Nov 27 '20 12:11 atinux