Skip to main content

interface Reducer.Instance<I,O>

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

Implemented by: InstanceImpl<I,O,S>

Type parameters

NameDescription
Ithe input element type
Othe output element type

Properties

halted

Returns true if the reducer instance does not receive any more values, false otherwise.

Definition

get halted(): boolean;

index

Returns the index of the last received value.

Definition

get index(): number;

Methods

getOutput

Returns the output value based on the current given input values.

Definition

getOutput(): O;

halt

Method that, when called, halts the reducer instance so that it will no longer receive values.

Definition

halt(): void;

next

Sends a new value into the reducer instance.

Definition

next(value: I): void;

Parameters

NameTypeDescription
valueIthe next input value