InnerUpdate

class InnerUpdate<M, E, F, MI, EI, FI>(val innerUpdate: Update<MI, EI, FI>, val modelExtractor: Function<M, MI>, val eventExtractor: Function<E, EI?>, val modelUpdater: BiFunction<M, MI, M>, val innerEffectHandler: InnerEffectHandler<M, F, FI>) : Update<M, E, F>

Helper class for putting an update function inside another update function.

It is sometimes useful to compose two update functions that each have their own model, events, and effects. Typically, when you do this you will store the inner model inside the outer model, and route some outer events to the inner update function. This class helps you wire up this conversion between inner and outer model, events, and effects.

The outer update function must still make the decision if the inner update function should be called or not, this class only helps with converting the types of the inner update function

Parameters

M

the outer model type

E

the outer event type

F

the outer effect type

MI

the inner model type

EI

the inner event type

FI

the inner effect type

Constructors

Link copied to clipboard
constructor(innerUpdate: Update<MI, EI, FI>, modelExtractor: Function<M, MI>, eventExtractor: Function<E, EI?>, modelUpdater: BiFunction<M, MI, M>, innerEffectHandler: InnerEffectHandler<M, F, FI>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun update(model: M, event: E): Next<M, F>