Very Fast (Least Recently Used) Cache For AssemblyScript
- AssemblyScript Compatible
- Isomorphic (Browser / Node)
- Based On Map
~ npm install as-lru --save
Basic Usage
import { QuickLRU } from 'as-lru'
const cache = new QuickLRU<string, string>(1000)
cache.set('Example', 'Hello World π')
// Make sure to use cache.has(). Otherwise, it can throw an error.
if (cache.has('Example')) {
cache.get('Example')
//=> 'Hello World π' / Undefined If Removed
}
Create A New QuickLRU Instance
As always, please star the repository! π₯³