Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/proximity/map-custom/index.ts>ProximityMapBuilder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class ProximityMapBuilder
implements [ProximityMap.Builder]<K, V>
Re-export
import { ProximityMapBuilder } from "https://deno.land/x/rimbu@1.2.1/proximity/map-custom/index.ts";

Constructors

new
ProximityMapBuilder(context: ProximityMap.Context<K>, source?: ProximityMap.NonEmpty<K, V>)

Properties

private
readonly
internalBuilder: HashMap.Builder<K, V>
addEntries: (entries: StreamSource<readonly [K, V]>) => boolean
addEntry: (entry: readonly [K, V]) => boolean
build: () => ProximityMap<K, V>
buildMapValues: <V2>(mapFun: (value: V, key: K) => V2) => ProximityMap<K, V2>
forEach: (f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, options?: { state?: TraverseState; }
) => void
get: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O

Applying get() to the Builder does NOT apply the proximity algorithm - which would be pointless at this construction stage; the internal, hash-based builder is queried instead

hasKey: <UK = K>(key: RelatedTo<K, UK>) => boolean
readonly
isEmpty: boolean
modifyAt: (key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (<V2 extends V = V>(currentValue: V & V2, remove: Token) => V | Token) | V; }) => boolean
removeKey: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O
removeKeys: <UK = K>(keys: StreamSource<RelatedTo<K, UK>>) => boolean
set: (key: K, value: V) => boolean
readonly
size: number
updateAt: <O>(
key: K,
update: RMapBase.Update<V>,
otherwise?: OptLazy<O>,
) => V | O