Skip to content

Adding control of expiration time in localstorage. Issue #133.#153

Open
rodrigo-morais wants to merge 2 commits intogrevory:masterfrom
rodrigo-morais:master
Open

Adding control of expiration time in localstorage. Issue #133.#153
rodrigo-morais wants to merge 2 commits intogrevory:masterfrom
rodrigo-morais:master

Conversation

@rodrigo-morais
Copy link
Copy Markdown

Hello,

I created a control to expiration time in localstorage.

For example:
localStorageService.get('key', 300000); -> Verify if expiration time happened for 5 minutes in milliseconds.

Important, when need use localstorage against sessionstorage and must control expiration time.

Thanks.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.05%) when pulling e92355a on rodrigo-morais:master into d85bdb5 on grevory:master.

@a8m
Copy link
Copy Markdown
Collaborator

a8m commented Oct 23, 2014

Ah.. I got it.
It's not a real expiration, the value still in the localStorage...
mm.. I'm think we need the users feedback..

@rodrigo-morais
Copy link
Copy Markdown
Author

If everyone think necessary, I can clear the key in localStorage.

I didn't that because in my use case was unnecessary and I not thought about.

@eshleebien
Copy link
Copy Markdown

this is very useful! (y)

@brandonburkett
Copy link
Copy Markdown

Is this TTL support basically? if so, I rolled my own but would love to use the "built in" one.

@brantje
Copy link
Copy Markdown

brantje commented Nov 1, 2014

Would be awsome to have this.

@rodrigo-morais
Copy link
Copy Markdown
Author

Hello,

I added for expiration data the option to remove key from localStorage.
When method get is called with true in last/third parameter and expiration happen then the key will be remove from localStorage.

For example:
localStorageService.get('key', 300000, true); -> Verify if expiration time happened for 5 minutes in milliseconds and if happens the key will be remove from localStorage.

The standard of remove flag is false. If not pass anything in parameter the key won't be remove.

Thanks.

@Mouvedia
Copy link
Copy Markdown

I need this.

@raduq
Copy link
Copy Markdown

raduq commented Oct 26, 2016

I want this feature.

@grevory
Copy link
Copy Markdown
Owner

grevory commented Jun 19, 2017

Is anyone interested in fixing up this PR? This seems to be very desired among users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants