Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cache_mapset/mod.ts>LRUSet

Maps and Sets with cache replacement policies, TC39 proposal-policy-map-set implementation
Latest
class LRUSet
extends BaseSet<T>
import { LRUSet } from "https://deno.land/x/cache_mapset@1.0.0/mod.ts";

Set with an upper limit, objects like. When the upper limit is reached, replaces the value with LRU algorithm.

Examples

Example 1

import { LRUSet } from "https://deno.land/x/cache_mapset@$VERSION/lru.ts";

declare const maxNumOfValues: number;
const set = new LRUSet(maxNumOfValues);

Constructors

new
LRUSet(maxNumOfValues: number, values?: Readonly<Iterable<T>>)

Properties

protected
cache: LRUMap<T, void>