angular-local-storage
angular-local-storage copied to clipboard
Adding control of expiration time in localstorage. Issue #133.
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.
Coverage decreased (-0.05%) when pulling e92355a69760502a06e3d01ac7984175e17f184a on rodrigo-morais:master into d85bdb5b24879ea956455647558df745baacf788 on grevory:master.
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..
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.
this is very useful! (y)
Is this TTL support basically? if so, I rolled my own but would love to use the "built in" one.
Would be awsome to have this.
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.
I need this.
I want this feature.
Is anyone interested in fixing up this PR? This seems to be very desired among users.