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.
mapInput
Reducer
instance that converts its input values using given mapFun
before passing them to this reducer.next
undocumented
next
Definition
readonly next: (state: S, elem: I, index: number, halt: () => void) => S;
stateToResult
undocumented
stateToResult
Definition
readonly stateToResult: (state: S, index: number, halted: boolean) => O;
Methods
chain
undocumented
chain
collectInput
undocumented
collectInput
compile
undocumented
compile
dropInput
undocumented
dropInput
filterInput
undocumented
filterInput
flatMapInput
undocumented
flatMapInput
Definition
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
mapInput
mapOutput
undocumented
mapOutput
next
Returns the next state based on the given input values:
next
sliceInput
undocumented
sliceInput
stateToResult
Returns the output value based on the given state
.
stateToResult
state
.takeInput
undocumented
takeInput