Skip to main content
Module

x/rimbu/ordered/map-custom/index.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>
Re-export
import { OrderedMapBuilder } from "https://deno.land/x/rimbu@0.14.0/ordered/map-custom/index.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