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

x/rimbu/stream/async-custom/index.ts>AsyncStreamBase

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class AsyncStreamBase
implements AsyncStream<T>
Abstract
import { AsyncStreamBase } from "https://deno.land/x/rimbu@1.0.3/stream/async-custom/index.ts";

Methods

append(value: AsyncOptLazy<T>): AsyncStream.NonEmpty<T>
assumeNonEmpty(): AsyncStream.NonEmpty<T>
asyncStream(): this
collect<R>(collectFun: AsyncCollectFun<T, R>): AsyncStream<R>
contains(
searchValue: T,
amount?,
eq?: Eq<T>,
): Promise<boolean>
containsSlice(source: AsyncStreamSource.NonEmpty<T>, eq?): Promise<boolean>
count(): Promise<number>
countElement(value: T, eq?): Promise<number>
countNotElement(value: T, eq?): Promise<number>
drop(amount: number): AsyncStream<T>
dropWhile(pred: (value: T, index: number) => MaybePromise<boolean>): AsyncStream<T>
elementAt<O>(index: number, otherwise?: AsyncOptLazy<O>): Promise<T | O>
equals(other: AsyncStreamSource<T>, eq?: Eq<T>): Promise<boolean>
every(pred: (value: T, index: number) => MaybePromise<boolean>): Promise<boolean>
filter(pred: (
value: T,
index: number,
halt: () => void,
) => MaybePromise<boolean>
): AsyncStream<T>
filterNot(pred: (
value: T,
index: number,
halt: () => void,
) => MaybePromise<boolean>
): AsyncStream<T>
filterNotPure<A extends readonly unknown[]>(pred: (value: T, ...args: A) => MaybePromise<boolean>, ...args: A): AsyncStream<T>
filterPure<A extends readonly unknown[]>(pred: (value: T, ...args: A) => MaybePromise<boolean>, ...args: A): AsyncStream<T>
find<O>(
pred: (value: T, index: number) => MaybePromise<boolean>,
occurrance?,
otherwise?: AsyncOptLazy<O>,
): Promise<T | O>
first<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O>
flatMap<T2>(flatMapFun: (
value: T,
index: number,
halt: () => void,
) => AsyncStreamSource<T2>
): AsyncStream<T2>
flatZip<T2>(flatMapFun: (
value: T,
index: number,
halt: () => void,
) => AsyncStreamSource<T2>
): AsyncStream<[T, T2]>
fold<R>(init: AsyncOptLazy<R>, next: (
current: R,
value: T,
index: number,
halt: () => void,
) => MaybePromise<R>
): Promise<R>
foldStream<R>(init: AsyncOptLazy<R>, next: (
current: R,
value: T,
index: number,
halt: () => void,
) => MaybePromise<R>
): AsyncStream<R>
forEach(f: (
value: T,
index: number,
halt: () => void,
) => MaybePromise<void>
, state?
): Promise<void>
forEachPure<A extends readonly unknown[]>(f: (value: T, ...args: A) => MaybePromise<void>, ...args: A): Promise<void>
indexed(startIndex?): AsyncStream<[number, T]>
indexOf(
searchValue: T,
occurrance?,
eq?: Eq<T>,
): Promise<number | undefined>
indexWhere(pred: (value: T, index: number) => MaybePromise<boolean>, occurrance?): Promise<number | undefined>
indicesOf(searchValue: T, eq?: Eq<T>): AsyncStream<number>
indicesWhere(pred: (value: T) => MaybePromise<boolean>): AsyncStream<number>
join(unnamed 0?): Promise<string>
last<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O>
map<T2>(mapFun: (value: T, index: number) => MaybePromise<T2>): AsyncStream<T2>
mapPure<T2, A extends readonly unknown[]>(mapFun: (value: T, ...args: A) => MaybePromise<T2>, ...args: A): AsyncStream<T2>
max<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O>
maxBy<O>(compare: (v1: T, v2: T) => number, otherwise?: AsyncOptLazy<O>): Promise<T | O>
min<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O>
minBy<O>(compare: (v1: T, v2: T) => number, otherwise?: AsyncOptLazy<O>): Promise<T | O>
mkGroup(unnamed 0?): any
prepend(value: AsyncOptLazy<T>): AsyncStream.NonEmpty<T>
reduce<R>(reducer: AsyncReducer<T, R>): Promise<R>
reduceAll<R extends [unknown, unknown, ...unknown[]]>(...reducers: [K in keyof R]: AsyncReducer<T, R[K]>): Promise<any>
reduceAllStream<R extends [unknown, unknown, ...unknown[]]>(...reducers: [K in keyof R]: AsyncReducer<T, R[K]>): any
reduceStream<R>(reducer: AsyncReducer<T, R>): AsyncStream<R>
repeat(amount?: number): AsyncStream<T>
single<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O>
some(pred: (value: T, index: number) => MaybePromise<boolean>): Promise<boolean>
splitOn(sepElem: T, eq?: Eq<T>): AsyncStream<T[]>
splitWhere(pred: (value: T, index: number) => MaybePromise<boolean>): AsyncStream<T[]>
take(amount: number): AsyncStream<T>
takeWhile(pred: (value: T, index: number) => MaybePromise<boolean>): AsyncStream<T>
toArray(): Promise<T[]>
toJSON(): Promise<ToJSON<T[], "AsyncStream">>
toString(): string
window<R>(
windowSize: number,
skipAmount?,
collector?: AsyncReducer<T, R>,
): AsyncStream<R>