Controller

org.terminal21.client.Controller
See theController companion class
object Controller

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Controller.type

Members list

Value members

Concrete methods

def apply[M](modelViewFunction: () => M)(using session: ConnectedSession): Controller[M]

Call this for a full blown model-view-controller

Call this for a full blown model-view-controller

Type parameters

M

the type of the model

Value parameters

modelViewFunction

a function (M, Events) => MV[M] which should process the events and render Seq[UiElement]

session

the ConnectedSession

Attributes

Returns

Controller[M], call render(initialModel) and then iterator or run()

def noModel(component: UiElement)(using session: ConnectedSession): Controller[Unit] & NoModelController

Call this id you just want to render some information UI that won't receive events.

Call this id you just want to render some information UI that won't receive events.

Value parameters

component

a single component (and it's children) to be rendered

session

ConnectedSession

Attributes

Returns

the controller.

def noModel(components: Seq[UiElement])(using session: ConnectedSession): Controller[Unit] & NoModelController

Call this id you just want to render some information UI that won't receive events.

Call this id you just want to render some information UI that won't receive events.

Value parameters

components

components to be rendered

session

ConnectedSession

Attributes

Returns

the controller.

def noModel(materializer: Events => Seq[UiElement])(using session: ConnectedSession): Controller[Unit] & NoModelController

Call this if you have no model but still want to receive events. I.e. a form with just an "Ok" button

Call this if you have no model but still want to receive events. I.e. a form with just an "Ok" button

Value parameters

materializer

a function that will be called initially to render the UI and whenever there is an event to render any changes to the UI

session

ConnectedSession

Attributes

Returns

the controller.