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

x/rimbu/ordered/map-custom/implementation/builder.ts>OrderedMapBuilder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class OrderedMapBuilder
implements [OrderedMapBase.Builder]<K, V, Tp>
import { OrderedMapBuilder } from "https://deno.land/x/rimbu@0.14.0/ordered/map-custom/implementation/builder.ts";

Constructors

new
OrderedMapBuilder(context: WithKeyValue<Tp, K, V>["context"], source?: TpG["nonEmpty"])

Type Parameters

K
V
optional
Tp extends OrderedMapTypes = OrderedMapTypes
optional
TpG extends WithKeyValue<Tp, K, V> = WithKeyValue<Tp, K, V>

Properties

optional
_keyOrderBuilder: List.Builder<K>
_lock: boolean
optional
_mapBuilder: TpG["sourceBuilder"]
addEntries: (entries: StreamSource<readonly [K, V]>) => boolean
addEntry: (entry: readonly [K, V]) => boolean
build: () => WithKeyValue<Tp, K, V>["normal"]
buildMapValues: <V2>(f: (value: V, key: K) => V2) => WithKeyValue<Tp, K, V2>["normal"]
forEach: (f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, state?: TraverseState
) => void
get: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O
hasKey: <UK>(key: RelatedTo<K, UK>) => boolean
readonly
isEmpty: boolean
readonly
keyOrderBuilder: List.Builder<K>
readonly
mapBuilder: TpG["sourceBuilder"]
modifyAt: (key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentValue: V, remove: Token) => V | Token; }) => 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
readonly
size: number
updateAt: <O>(
key: K,
update: Update<V>,
otherwise?: OptLazy<O>,
) => V | O