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

x/rimbu/hashed/map-custom/index.ts>HashMapBlockBuilder

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

Constructors

new
HashMapBlockBuilder(
context: HashMapContext<K>,
source?: undefined | HashMapBlock<K, V>,
_entries?: undefined | (readonly [K, V])[],
_entrySets?: undefined | MapBlockBuilderEntry<K, V>[],
size?,
level?,
)

Properties

_lock: number
addEntries: (source: StreamSource<readonly [K, V]>) => boolean
addEntry: (entry: readonly [K, V]) => boolean
build: () => HashMap<K, V>
buildMapValues: <V2>(f: (value: V, key: K) => V2) => HashMap<K, V2>
readonly
entries: (readonly [K, V])[]
readonly
entrySets: MapBlockBuilderEntry<K, V>[]
forEach: (f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, state?: TraverseState
) => void
get: <UK, O>(
key: RelatedTo<K, UK>,
otherwise?: OptLazy<O>,
hash?: number,
) => V | O
hasKey: <UK>(key: RelatedTo<K, UK>) => boolean
modifyAt: (
key: K,
options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentValue: V, remove: Token) => V | Token; },
keyHash?,
) => boolean
removeKey: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O
removeKeys: <UK>(keys: StreamSource<RelatedTo<K, UK>>) => boolean
set: (key: K, value: V) => boolean
updateAt: <O>(
key: K,
update: Update<V>,
otherwise?: OptLazy<O>,
) => V | O

Methods

addEntryInternal(entry: readonly [K, V], hash?): boolean
checkLock(): void