class Base<I,O,S>
A base class that can be used to easily create Reducer instances.
Implements: Reducer.Impl<I,O,S>
Type parameters
| Name | Description |
|---|---|
| I | the input value type |
| O | the output value type |
| S | the internal state type |
Properties
mapInput
Returns a Reducer instance that converts its input values using given mapFun before passing them to this reducer.
mapInputReducer instance that converts its input values using given mapFun before passing them to this reducer.next
undocumented
nextDefinition
readonly next: (state: S, elem: I, index: number, halt: () => void) => S;
stateToResult
undocumented
stateToResultDefinition
readonly stateToResult: (state: S, index: number, halted: boolean) => O;
Methods
chain
undocumented
chaincollectInput
undocumented
collectInputcompile
undocumented
compiledropInput
undocumented
dropInputfilterInput
undocumented
filterInputflatMapInput
undocumented
flatMapInputDefinition
flatMapInput<I2>(flatMapFun: (value: I2, index: number) => StreamSource<I>): Reducer<I2, O>;
Type parameters
| Name | Description |
|---|---|
| I2 |
Parameters
| Name | Type | Description |
|---|---|---|
flatMapFun | (value: I2, index: number) => StreamSource<I> |
Overrides
mapInput
undocumented
mapInputmapOutput
undocumented
mapOutputnext
Returns the next state based on the given input values:
nextsliceInput
undocumented
sliceInputstateToResult
Returns the output value based on the given state.
stateToResultstate.takeInput
undocumented
takeInput