Skip to main content
Module

x/cache_mapset/lfu.ts>LFUSet

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

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

Examples

Example 1

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

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

Constructors

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

Properties

protected
cache: LFUMap<T, void>