Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
released v2
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard committed Oct 31, 2021
1 parent e69e94e commit 4f0e02e
Show file tree
Hide file tree
Showing 12 changed files with 840 additions and 625 deletions.
Empty file removed build.js
Empty file.
2 changes: 0 additions & 2 deletions dev.js

This file was deleted.

25 changes: 25 additions & 0 deletions dev/instance.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Cachu } from '../src/instance.mjs'

const cachu = new Cachu({
maxAge: 300
})

async function dev() {
await cachu.set(1, 'other')

setTimeout(async () => {
await cachu.set(2, 'item')
}, 250)

setTimeout(async () => {
await cachu.set(3, 'item')
}, 500)

setTimeout(async () => {
console.log(await cachu.purgeManyByCondition(item => {
return item[1] === 'other'
}))
console.log(cachu.store)
}, 1000)
}
dev()
Loading

0 comments on commit 4f0e02e

Please sign in to comment.