Connectable

fun interface Connectable<I, O>

API for something that can be connected to be part of a MobiusLoop.

Primarily used in Mobius.loop to define the effect handler of a Mobius loop. In that case, the incoming values will be effects, and the outgoing values will be events that should be sent back to the loop.

Alternatively used in MobiusLoop.Controller.connect to connect a view to the controller. In that case, the incoming values will be models, and the outgoing values will be events.

Parameters

I

the incoming value type

O

the outgoing value type

Inheritors

Functions

Link copied to clipboard
abstract fun connect(output: Consumer<O>): Connection<I>

Create a new connection that accepts input values and sends outgoing values to a supplied consumer.