Skip to main content
Module

x/cache_mapset/lifo.ts>LIFOSet

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

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

Examples

Example 1

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

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

Constructors

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

Properties

protected
cache: LIFOMap<T, void>