Home Reference Source Test
import {StreamWalker} from 'eventstore-ts-client/src/StreamWalker.ts'
public class | source

StreamWalker

Stream walker

Constructor Summary

Public Constructor
public

Creates an instance of stream walker.

Member Summary

Protected Members
protected

iterable: AsyncIterableIterator

iterable

Method Summary

Public Methods
public

standard async iterable function

public

async every(fn: Function, thisArg: Function): Promise

The every() method tests whether all elements in the iterator pass the test implemented by the provided function

public

The filter() method creates a new iterator with all elements that pass the test implemented by the provided function

public

async forEach(fn: Function, thisArg: Function, args: ...*): Promise

The forEach() method executes a provided function once for each iterator element

public

map(fn: Function, thisArg: Function): StreamWalker

The map() method creates a new iterator with the results of calling a provided function on every element in the calling iterator

public

async reduce(accumulatorFunction: Function, initialValue: , thisArg: Function): Promise

The reduce() method applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value

public

async toArray(): Promise

Converts an iterator to an array.

Public Constructors

public constructor() source

Creates an instance of stream walker.

Protected Members

protected iterable: AsyncIterableIterator source

iterable

Public Methods

public async * [Symbol.asyncIterator]() source

standard async iterable function

public async every(fn: Function, thisArg: Function): Promise source

The every() method tests whether all elements in the iterator pass the test implemented by the provided function

Params:

NameTypeAttributeDescription
fn Function
thisArg Function

public filter(fn: Function, thisArg: Function): StreamWalker source

The filter() method creates a new iterator with all elements that pass the test implemented by the provided function

Params:

NameTypeAttributeDescription
fn Function
thisArg Function

public async forEach(fn: Function, thisArg: Function, args: ...*): Promise source

The forEach() method executes a provided function once for each iterator element

Params:

NameTypeAttributeDescription
fn Function
thisArg Function
args ...*

public map(fn: Function, thisArg: Function): StreamWalker source

The map() method creates a new iterator with the results of calling a provided function on every element in the calling iterator

Params:

NameTypeAttributeDescription
fn Function
thisArg Function

public async reduce(accumulatorFunction: Function, initialValue: , thisArg: Function): Promise source

The reduce() method applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value

Params:

NameTypeAttributeDescription
accumulatorFunction Function
initialValue
  • optional
  • default: null
thisArg Function

public async toArray(): Promise source

Converts an iterator to an array. The returned array will contain all single elements of iterator