Skip to main content
Module

x/rimbu/stream/mod.ts

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
import * as rimbu from "https://deno.land/x/rimbu@1.1.0/stream/mod.ts";

Classes

A base class that can be used to easily create AsyncReducer instances.

A base class that can be used to easily create Reducer instances.

Variables

Returns an AsyncReducer that takes boolean values and outputs true if all input values are true, and false otherwise.

A Reducer that calculates the average of all given numberic input values.

Returns an AsyncReducer that remembers the amount of input items provided.

Returns an AsyncReducer that remembers the first input value.

Returns an AsyncReducer that remembers the first input value for which the given pred function returns true.

Returns an AsyncReducer that outputs true if no input values are received, false otherwise.

Returns an AsyncReducer that remembers the last input value.

Returns an AsyncReducer that remembers the last input value for which the given pred function returns true.

Returns a Reducer that remembers the maximum value of the numberic inputs.

Returns a Reducer that remembers the maximum value of the inputs using the given compFun to compare input values

Returns a Reducer that remembers the minimum value of the numberic inputs.

Returns a Reducer that remembers the minimum value of the inputs using the given compFun to compare input values

Returns an AsyncReducer that outputs true if one or more input values are received, false otherwise.

Returns an AsyncReducer that takes boolean values and outputs true if one or more input values are true, and false otherwise.

A Reducer that calculates the product of all given numeric input values.

A Reducer that sums all given numeric input values.

Returns an async transformer that produces windows/collections of windowSize size, each window starting skipAmount of elements after the previous, and optionally collected by a custom reducer.

Returns a Reducer that takes boolean values and outputs true if all input values are true, and false otherwise.

A Reducer that calculates the average of all given numberic input values.

Returns a Reducer that remembers the amount of input items provided.

Returns a Reducer that remembers the first input value.

Returns a Reducer that remembers the first input value for which the given pred function returns true.

Returns a Reducer that outputs true if no input values are received, false otherwise.

Returns a Reducer that remembers the last input value.

Returns a Reducer that remembers the last input value for which the given pred function returns true.

Returns a Reducer that remembers the maximum value of the numberic inputs.

Returns a Reducer that remembers the maximum value of the inputs using the given compFun to compare input values

Returns a Reducer that remembers the minimum value of the numberic inputs.

Returns a Reducer that remembers the minimum value of the inputs using the given compFun to compare input values

Returns a Reducer that outputs true if one or more input values are received, false otherwise.

Returns a Reducer that takes boolean values and outputs true if one or more input values are true, and false otherwise.

A Reducer that calculates the product of all given numeric input values.

A Reducer that sums all given numeric input values.

Returns a transformer that produces windows/collections of windowSize size, each window starting skipAmount of elements after the previous, and optionally collected by a custom reducer.

Functions

Returns a Reducer that combines multiple input reducers according to the given "shape" by providing input values to all of them and collecting the outputs in the shape.

Returns an AsyncReducer that outputs false as long as the given elem has not been encountered in the input values, true otherwise.

Returns an AsyncReducer with the given options:

Returns an AsyncReducer of which the input, state, and output types are the same.

Returns an AsyncReducer of which the state and output types are the same.

Returns an AsyncReducer that ouputs true as long as all input values satisfy the given pred, false otherwise.

Returns a Reducer that joins the given input values into a string using the given options.

Returns a Reducer that ouputs false as long as no input value satisfies given pred, true otherwise.

Returns an AsyncReducer that collects received input values in an array, and returns a copy of that array as an output value when requested.

Returns a AsyncReducer that collects received input tuples into a mutable JS Map, and returns a copy of that map when output is requested.

Returns an AsyncReducer that collects 2-tuples containing keys and values into a plain JS object, and returns a copy of that object when output is requested.

Returns an AsyncReducer that collects received input values into a mutable JS Set, and returns a copy of that map when output is requested.

Returns an async transformer that returns only those elements from the input that are different to previous element according to the optionally given eq function.

Returns a Reducer that combines multiple input reducers according to the given "shape" by providing input values to all of them and collecting the outputs in the shape.

Returns a Reducer that outputs false as long as the given elem has not been encountered in the input values, true otherwise.

Returns a Reducer with the given options:

Returns a Reducer of which the input, state, and output types are the same.

Returns a Reducer of which the state and output types are the same.

Returns a Reducer that ouputs true as long as all input values satisfy the given pred, false otherwise.

Returns a Reducer that joins the given input values into a string using the given options.

Returns a Reducer that ouputs false as long as no input value satisfies given pred, true otherwise.

Returns a Reducer that collects received input values in an array, and returns a copy of that array as an output value when requested.

Returns a Reducer that collects received input tuples into a mutable JS Map, and returns a copy of that map when output is requested.

Returns a Reducer that collects 2-tuples containing keys and values into a plain JS object, and returns a copy of that object when output is requested.

Returns a Reducer that collects received input values into a mutable JS Set, and returns a copy of that map when output is requested.

Returns a transformer that returns only those elements from the input that are different to previous element according to the optionally given eq function.

Interfaces

A possibly infinite asynchronous sequence of elements of type T. See the Stream documentation and the AsyncStream API documentation

A non-empty and possibly infinite asynchronous sequence of elements of type T. See the Stream documentation and the AsyncStream API documentation

An interface that extends the standard Iterable interface to return a FastIterator instead of a normal Iterator.

An iterator that extends the default Iterator interface with methods that give more performance.

The Implementation interface for a Reducer, which also exposes the internal state type.

A possibly infinite sequence of elements of type T. See the Stream documentation and the Stream API documentation

A non-empty and possibly infinite sequence of elements of type T. See the Stream documentation and the Stream API documentation

An object that can create a Stream of elements of type T.

An object that can create a non-empty Stream of elements of type T.

Type Aliases

An AsyncReducer is a stand-alone asynchronous calculation that takes input values of type I, and, when requested, produces an output value of type O.

An AsyncReducer that produces instances of AsyncStreamSource.

An AsyncReducer that produces instances AsyncStreamSource.NonEmpty.

A Reducer is a stand-alone calculation that takes input values of type I, and, when requested, produces an output value of type O.

Any object that is Iterable, a Stream, or can produce a Stream.

Any object that is a non-empty Stream, can produce a non-empty Stream, or is a non-empty array.

A Reducer that produces instances of StreamSource.

A Reducer that produces instances of StreamSource.NonEmpty.