reduce

abstract fun reduce(op: Value): JsPromise<Value>
abstract fun reduce(op: () -> Value): JsPromise<Value>

Reduce this stream to a single value.

Return

The reduced value.

Parameters

op

The reduction operation.


abstract fun reduce(op: Value, initial: Value): JsPromise<Value>

Reduce this stream to a single value.

Return

The reduced value.

Parameters

op

The reduction operation.

initial

The initial value.


abstract fun reduce(op: Value, initial: Value, options: Value): JsPromise<Value>

Reduce this stream to a single value.

Return

The reduced value.

Parameters

op

The reduction operation.

initial

The initial value.

options

The options for the reduce operation.


abstract fun reduce(initial: Value, op: () -> Value): JsPromise<Value>

Reduce this stream to a single value.

Return

The reduced value.

Parameters

initial

The initial value.

op

The reduction operation.


abstract fun reduce(initial: Value, options: ReadableReduceOptions, op: () -> Value): JsPromise<Value>

Reduce this stream to a single value.

Return

The reduced value.

Parameters

initial

The initial value.

op

The reduction operation.

options

The options for the reduce operation.