ComposeStateCallbacks
class ComposeStateCallbacks<T, R, U, V>(a: StateCallback<T, R, U>, b: StateCallback<T, U, V>) : StateCallback<T, R, V>
An implementation of StateCallback that composes two other state callbacks. Consider that we were only dealing with regular functions, this would give:
fun a(state: R): U
fun b(state: U): V
Content copied to clipboard
Then, this class would be equivalent to the following function:
fun composed(state: R): U = b(a(state))
Content copied to clipboard
Parameters
T
Context type, see NodeParameterKey for details
R
Input type of the a
state callback
U
Output type of the a
state callback and input type of the b
state callback
V
Output type of the b
state callback
Functions
Link copied to clipboard
Create a store map and evaluate this state callback. The map is returned.
Link copied to clipboard
Link copied to clipboard
fun <T, R> StateCallback<T, R, *>?.withStoreMap(value: R, currIndex: Int, handler: (Map<NodeParameterKey<T, *>, Any?>) -> ExpectationResult<T>): ExpectationResult<T>
Create a store map (using createStoreMap) and call the provided handler, returning an ExpectationResult.