interface AsyncReducer.Instance<I,O>
An async reducer instance that manages its own state based on the reducer definition that was used to create this instance.
Type parameters
| Name | Description |
|---|---|
| I | the input element type |
| O | the output element type |
Properties
halted
Returns true if the reducer instance does not receive any more values, false otherwise.
haltedDefinition
get halted(): boolean;
Methods
getOutput
Returns the output value based on the current given input values.
getOutputDefinition
getOutput(): MaybePromise<O>;
halt
Method that, when called, halts the reducer instance so that it will no longer receive values.
haltDefinition
halt(): void;
next
Sends a new value into the reducer instance.
nextDefinition
next(value: I): MaybePromise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
value | I | the next input value |