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

x/rimbu/stream/async/index.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.2.1/stream/async/index.ts";

Variables

Returns an AsyncReducer that remembers the first input value.

Returns an AsyncReducer that uses the valueToKey function to calculate a key for each value, and feeds the tuple of the key and the value to the collector reducer. Finally, it returns the output of the collector. If no collector is given, the default collector will return a JS multimap of the type Map<K, V[]>.

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

Returns an AsyncReducer that remembers the last input value.

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

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

Returns an AsyncReducer that splits the incoming values into two separate outputs based on the given pred predicate. Values for which the predicate is true are fed into the collectorTrue reducer, and other values are fed into the collectorFalse instance. If no collectors are provided the values are collected into arrays.

Returns an AsyncReducer instance that first applies this reducer, and then applies the given next reducer to each output produced by the previous reducer.

Returns an AsyncReducer that feeds incoming values to all reducers in the provided reducers source, and halts when the first reducer in the array is halted and returns the output of that reducer. Returns the otherwise value if no reducer is yet halted.

Returns an AsyncReducer that only produces an output value when having receives exactly one input value, otherwise will return the otherwise value or undefined.

Returns an async transformer that filters elements from the input stream based on the provided predicate function.

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.

Functions

Returns an AsyncReducer 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 returns true if the input values contain the given slice sequence amount times. Otherwise, returns false.

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 returns true if the last input values match the given slice values repeated amount times. Otherwise, returns false.

Returns an AsyncReducer that ouputs true when the received elements match the given other async stream source according to the eq instance, false otherwise.

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

Returns an AsyncReducer that uses the given init and next values to fold the input values into result values.

Returns an AsyncReducer from a given Reducer or AsyncReducer instance.

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

Returns a AsyncReducer that returns true if the first input values match the given slice values repeated amount times. Otherwise, returns false.

Returns an AsyncTransformer instance that converts or filters its input values using given collectFun before passing them to the reducer.

Returns an async transformer that applies the given flatMap function to each element of the input stream, and concatenates all the resulting resulting streams into one stream.

Returns an async transformer that applies the given flatMap function to each element of the input stream, and concatenates all the resulting resulting streams into one stream, where each resulting element is tupled with the originating input element.

Returns an AsyncTransformer based on a given synchronous or asynchronous transformer.

Returns an AsyncTransformer that outputs the index of each received element that satisfies the given predicate.

Returns an AsyncTransformer that inserts the given sep stream source elements between each received input element.

Returns an AsyncTransformer that collects the received elements into a collector that will be returned as output every time the input matches the given sepElem value.

Returns an AsyncTransformer that collects the received elements into a collector that will be returned as output every time the input matches the given sepSlice sequence of elements.

Returns an AsyncTransformer that applies the given pred function to each received element, and collects the received elements into a collector that will be returned as output every time the predicate returns true.

Interfaces

An asynchronous iterator that extends the default AsyncIterator interface with methods for improved performance.

The AsyncReducer implementation interface defining the required methods.

An async reducer instance that manages its own state based on the reducer definition that was used to create this instance.

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

Represents an object that can produce an asynchronous stream of values.

Represents a non-empty object that can produce an asynchronous stream of values.

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.

Convenience type to allow synchronous reducers to be supplied to functions that accept async reducers.

Type defining the result type of an async reducer combination for a given shape.

Type defining the allowed shape of async reducer combinations.

An AsyncReducer that produces instances of AsyncStreamSource.

Convenience type to allow synchronous transformers to be supplied to functions that accept async transformers.

Convenience type to allow non-empty synchronous transformers to be supplied to functions that accept non-empty async transformers.

An AsyncReducer that produces instances AsyncStreamSource.NonEmpty.