Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/collection-types/set-custom/index.ts>RSetBase.Builder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface RSetBase.Builder
import { type RSetBase } from "https://deno.land/x/rimbu@0.13.0/collection-types/set-custom/index.ts";
const { Builder } = RSetBase;

Properties

readonly
size: number

Returns the amount of values in the builder.

readonly
isEmpty: boolean

Returns true if there are no values in the builder.

Methods

has<U = T>(value: RelatedTo<T, U>): boolean

Returns true if the given value is present in the builder.

add(value: T): boolean

Adds given value to the builder.

addAll(values: StreamSource<T>): boolean

Adds the values in given values StreamSource to the builder.

remove<U = T>(value: RelatedTo<T, U>): boolean

Remove the given value from the builder.

removeAll<U = T>(values: StreamSource<RelatedTo<T, U>>): boolean

Removes the values in given values StreamSource from this builder.

forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void

Performs given function f for each value of the builder.

build(): WithElem<Tp, T>["normal"]

Returns an immutable instance containing the values in this builder.