import { type MultiSetBase } from "https://deno.land/x/rimbu@1.2.0/multiset/custom/interface/base.ts";
const { Factory } = MultiSetBase;
Type Parameters
Tp extends MultiSetBase.Types
Methods
Returns the (singleton) empty instance of this type and context with given key and value types.
of<T extends UT>(...values: ArrayNonEmpty<T>): WithElem<Tp, T>["nonEmpty"]
Returns an immutable multimap of this collection type and context, containing the given values
.
from<T extends UT>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<T>>): WithElem<Tp, T>["nonEmpty"]
Returns an immutable multimap of this type and context, containing the values in the given sources
StreamSource
.
from<T extends UT>(...sources: ArrayNonEmpty<StreamSource<T>>): WithElem<Tp, T>["normal"]
Returns an empty builder instance for this type of collection and context.
reducer<T extends UT>(source?: StreamSource<T>): Reducer<T, WithElem<Tp, T>["normal"]>
Returns a Reducer
that appends received items to a MultiSet and returns the MultiSet as a result. When a source
is given,
the reducer will first create a MultiSet from the source, and then add elements to it.