import { type RMapBase } from "https://deno.land/x/rimbu@0.13.0/collection-types/map-custom/interface/index.ts";
const { Builder } = RMapBase;
Properties
readonly
context: WithKeyValue<Tp, K, V>["context"]Returns the context
associated to this collection instance.
Methods
Returns the value associated with the given key
, or given otherwise
value if the key is not in the collection.
forEach(f: () => void, state?: TraverseState): void
Performs given function f
for each entry of the builder.
removeKeys<UK = K>(keys: StreamSource<RelatedTo<K, UK>>): boolean
Removes the entries in the given keys
StreamSource
from the builder.
modifyAt(key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: <V2 extends V = V>(currentValue: V & V2, remove: Token) => V | Token; }): boolean
Modifies or creates the builder entry with given atKey
as its key according to given options
.
updateAt(key: K, update: RMapBase.Update<V>): V | undefined
Updates the value in the builder associated with given key
according to given update
value or function.
updateAt<O>(): V | O
build(): WithKeyValue<Tp, K, V>["normal"]
Returns an immutable collection instance containing the entries in this builder.