connect

abstract fun connect(view: Connectable<M, E>)

Connect a view to this controller.

Must be called before start.

The Connectable will be given an event consumer, which the view should use to send events to the MobiusLoop. The view should also return a Connection that accepts models and renders them. Disposing the connection should make the view stop emitting events.

The view Connectable is guaranteed to only be connected once, so you don't have to check for multiple connections or throw ConnectionLimitExceededException.

Throws

if the loop is running or if the controller already is connected