Next

class Next<M, F>

This class represents the result of calling an Update function.

Upon calling an Update function with an Event and Model, a Next object will be returned that contains the new Model (if there is one) and Effect objects that describe which side-effects should take place.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun effects(): Set<F>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Check if this Next contains effects.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Check if this Next contains a model.

Link copied to clipboard
fun ifHasModel(consumer: Consumer<M>)

If the model is present, call the given consumer with it, otherwise do nothing.

Link copied to clipboard
fun model(): M?
Link copied to clipboard
fun modelOrElse(fallbackModel: M): M

Try to get the model from this Next, with a fallback if there isn't one.

Link copied to clipboard
fun modelUnsafe(): M

Get the model of this Next. This version is unsafe - if this next doesn't have a model, calling this method will cause an exception to be thrown.

Link copied to clipboard
open override fun toString(): String