Skip to content

Commit

Permalink
0.1.10: Add examples of supporting expiration time in the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaBao committed Feb 26, 2021
1 parent 9fceb93 commit da11126
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ myStore.all();
// animals: [ 'fox', 'dog' ]
// }
```

### ExpireStorage

```javascript
import { ExpireStorage } from '@alphabao/tiny-storage';

const store = new ExpireStorage('expStore');

// get an expired key
store.set('exp0', 'val', 0);
store.get('exp0'); // output: null

// get an unexpired key
store.set('k', 'val', 60 * 60 * 60);
store.get('k'); // output: 'val'
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alphabao/tiny-storage",
"version": "0.1.9",
"version": "0.1.10",
"description": "A tiny localStorage util",
"repository": {
"type": "git",
Expand Down

0 comments on commit da11126

Please sign in to comment.