Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/table/custom/index.ts>TableBase.Factory

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

Type Parameters

Tp extends TableBase.Types
optional
UR = unknown
optional
UC = unknown

Methods

empty<R extends UR, C extends UC, V>(): WithRow<Tp, R, C, V>["normal"]

Returns the (singleton) empty instance of this type and context with given key and value types.

of<R extends UR, C extends UC, V>(...entries: ArrayNonEmpty<readonly [R, C, V]>): WithRow<Tp, R, C, V>["nonEmpty"]

Returns an immutable multimap of this collection type and context, containing the given entries.

from<R extends UR, C extends UC, V>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<readonly [R, C, V]>>): WithRow<Tp, R, C, V>["nonEmpty"]

Returns an immutable table of this type and context, containing the entries in the given sources StreamSource instances.

from<R extends UR, C extends UC, V>(...sources: ArrayNonEmpty<StreamSource<readonly [R, C, V]>>): WithRow<Tp, R, C, V>["normal"]
builder<R extends UR, C extends UC, V>(): WithRow<Tp, R, C, V>["builder"]

Returns an empty builder instance for this type of collection and context.

reducer<R extends UR, C extends UC, V>(source?: StreamSource<readonly [R, C, V]>): Reducer<[R, C, V], WithRow<Tp, R, C, V>["normal"]>

Returns a Reducer that adds received tuples to a Table and returns the Table as a result. When a source is given, the reducer will first create a Table from the source, and then add tuples to it.