Skip to content
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

add expiration time? #28

Open
sabermazoji opened this issue Oct 24, 2020 · 2 comments
Open

add expiration time? #28

sabermazoji opened this issue Oct 24, 2020 · 2 comments
Labels
kind: feature New feature or request scope: integration Related to an integration, not necessarily to core (but could influence core) solution: workaround available There is a workaround available for this

Comments

@sabermazoji
Copy link

it is possible to add an expire time for local storage?

@agilgur5 agilgur5 changed the title add expire time add expiration time? Oct 25, 2020
@agilgur5
Copy link
Owner

@sabermazoji so localStorage has no expiration built-in.

If you'd like to expire entries in your app, you'd have to add an expiration field or something to your models and just throw away any objects that are dated. There's a guide on doing this with localStorage directly, but the same concept could apply here.

Once I finally merge Transforms (#16) (which is unfortunately still blocked by multi-entry support upstream...), one could make a custom transform that encapsulates those details away from your app though

@agilgur5 agilgur5 added scope: integration Related to an integration, not necessarily to core (but could influence core) solution: workaround available There is a workaround available for this kind: feature New feature or request labels Oct 25, 2020
@agilgur5
Copy link
Owner

For anyone else finding this, there are also other storage engines that support expiration out-of-the-box, such as localstorage-slim, localforage-cache, and likely many others (found those from a very quick search).

A Transform could still abstract this kind of functionality to a higher level in order to apply to many different storage engines.
Different options with different trade-offs to them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request scope: integration Related to an integration, not necessarily to core (but could influence core) solution: workaround available There is a workaround available for this
Projects
None yet
Development

No branches or pull requests

2 participants