import { type RSetBase } from "https://deno.land/x/rimbu@1.1.0/collection-types/set-custom/interface/base.ts";
const { Factory } = RSetBase;
Type Parameters
Tp extends RSetBase.Types
Methods
Returns the (singleton) empty instance of this type and context with given value type.
of<T extends UT>(...values: ArrayNonEmpty<T>): WithElem<Tp, T>["nonEmpty"]
Returns an immutable set of this type and context, containing the given values
.
from<T extends UT>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<T>>): WithElem<Tp, T>["nonEmpty"]
Returns an immutable set of this collection type and context, containing the given values in source
.
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 an RSet and returns the RSet as a result. When a source
is given,
the reducer will first create an RSet from the source, and then append elements to it.