TyrianAppF

trait TyrianAppF[F[_], Msg, Model]

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

class Object
trait Matchable
class Any
trait TyrianApp[Msg, Model]

Value members

Abstract methods

def init(flags: Map[String, String]): (Model, Cmd[F, Msg])

Used to initialise your app. Accepts simple flags and produces the initial model state, along with any commands to run at start up, in order to trigger other processes.

Used to initialise your app. Accepts simple flags and produces the initial model state, along with any commands to run at start up, in order to trigger other processes.

def subscriptions(model: Model): Sub[F, Msg]

Subscriptions are typically processes that run for a period of time and emit discrete events based on some world event, e.g. a mouse moving might emit it's coordinates.

Subscriptions are typically processes that run for a period of time and emit discrete events based on some world event, e.g. a mouse moving might emit it's coordinates.

def update(model: Model): Msg => (Model, Cmd[F, Msg])

The update method allows you to modify the model based on incoming messages (events). As well as an updated model, you can also produce commands to run.

The update method allows you to modify the model based on incoming messages (events). As well as an updated model, you can also produce commands to run.

def view(model: Model): Html[Msg]

Used to render your current model into an HTML view.

Used to render your current model into an HTML view.

Concrete methods

Specifies the number of queued tasks that can be consumed at any one time. Default is 1024 which is assumed to be more than sufficient, however the value can be tweaked in your app by overriding this value.

Specifies the number of queued tasks that can be consumed at any one time. Default is 1024 which is assumed to be more than sufficient, however the value can be tweaked in your app by overriding this value.

def launch(containerId: String): Unit

Launch the app and attach it to an element with the given id. Can be called from Scala or JavaScript.

Launch the app and attach it to an element with the given id. Can be called from Scala or JavaScript.

def launch(node: Element): Unit

Launch the app and attach it to the given element. Can be called from Scala or JavaScript.

Launch the app and attach it to the given element. Can be called from Scala or JavaScript.

def launch(containerId: String, flags: Dictionary[String]): Unit

Launch the app and attach it to an element with the given id, with the supplied simple flags. Can be called from Scala or JavaScript.

Launch the app and attach it to an element with the given id, with the supplied simple flags. Can be called from Scala or JavaScript.

def launch(node: Element, flags: Dictionary[String]): Unit

Launch the app and attach it to the given element, with the supplied simple flags. Can be called from Scala or JavaScript.

Launch the app and attach it to the given element, with the supplied simple flags. Can be called from Scala or JavaScript.

def launch(containerId: String, flags: Map[String, String]): Unit

Launch the app and attach it to an element with the given id, with the supplied simple flags. Can only be called from Scala.

Launch the app and attach it to an element with the given id, with the supplied simple flags. Can only be called from Scala.

def launch(node: Element, flags: Map[String, String]): Unit

Launch the app and attach it to the given element, with the supplied simple flags. Can only be called from Scala.

Launch the app and attach it to the given element, with the supplied simple flags. Can only be called from Scala.

def ready(node: Element, flags: Map[String, String]): Unit

Abstract fields

val run: Resource[F, TyrianRuntime[F, Model, Msg]] => Unit