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

x/rimbu/core/menu/map/index.ts>Proximity.Context

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface Proximity.Context
implements [RMapBase.Context]<UK, ProximityMap.Types>
import { type Proximity } from "https://deno.land/x/rimbu@1.0.2/core/menu/map/index.ts";
const { Context } = Proximity;

A context instance for a ProximityMap that acts as a factory for every instance of this type of collection.

Properties

readonly
typeTag: "ProximityMap"
readonly
distanceFunction: DistanceFunction<UK>

The function used to compute the distance between stored keys and any research key

readonly
hashMapContext: HashMap.Context<UK>

The context used by the internal HashMap

Methods

createBuilder<K extends UK, V>(source?: ProximityMap.NonEmpty<K, V>): ProximityMap.Builder<K, V>

Creates a builder given the optional non-empty source map