Controller

org.terminal21.client.Controller
See theController companion object
class Controller[M](eventIteratorFactory: => Iterator[CommandEvent], renderChanges: (Seq[UiElement]) => Unit, modelViewFunction: () => M)

Controller manages the changes in the model by receiving events. Also the rendering of the view (which is UiElements).

Type parameters

M

the type of the model

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def render(initialModel: M): RenderedController[M]

Sends the initialModel along with an InitialRender event to the modelViewFunction and renders the resulting UI.

Sends the initialModel along with an InitialRender event to the modelViewFunction and renders the resulting UI.

Value parameters

initialModel

the initial state of the model

Attributes

Returns

a RenderedController. Call run() or iterator on that.