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

x/rimbu/list/custom/index.ts>LeafBlock

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class LeafBlock
implements Block<T, LeafBlock<T>, T>
Re-export
import { LeafBlock } from "https://deno.land/x/rimbu@0.14.0/list/custom/index.ts";

Constructors

new
LeafBlock(context: ListContext, children: readonly T[])

Properties

readonly
canAddChild: boolean
readonly
childrenInMax: boolean
readonly
childrenInMin: boolean
readonly
length: number
readonly
level: 0
readonly
mutateChildren: T[]

Methods

_mutateNormalize(): List.NonEmpty<T>
append(value: T): List.NonEmpty<T>
concat<T2>(...sources: ArrayNonEmpty<StreamSource<T2>>): List.NonEmpty<T | T2>
concatBlock(other: LeafBlock<T>): List.NonEmpty<T>
copy(children: readonly T[]): LeafBlock<T>
copy2<T2>(children: readonly T2[]): LeafBlock<T2>
drop(amount: number): List<T>
dropChildren(childAmount: number): LeafBlock<T>
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
get<O>(index: number, otherwise?: OptLazy<O>): T | O
map<T2>(
mapFun: (value: T, index: number) => T2,
reversed?,
indexOffset?,
): LeafBlock<T2>
mapPure<T2>(
mapFun: (value: T) => T2,
reversed?,
cacheMap?,
): LeafBlock<T2>
prepend(value: T): List.NonEmpty<T>
reversed(cacheMap?): LeafBlock<T>
stream(reversed?): Stream.NonEmpty<T>
streamRange(range: IndexRange, reversed?): Stream<T>
structure(): string
take(amount: number): List<T> | any
takeChildren(childAmount: number): LeafBlock<T>
toArray(range?: IndexRange, reversed?): T[] | any
updateAt(index: number, update: Update<T>): LeafBlock<T>