lustre

Lustre is a declarative framework for building Web apps in Gleam.

Types

An App describes a Lustre application: what state it holds and what kind of actions get dispatched to update that model. The only useful thing you can do with an App is pass it to start.

You can construct an App from the two constructors exposed in this module: basic and application. Although you can’t do anything but start them, the constructors are separated in case you want to set up an application but defer starting it until some later point in time.

                                         +--------+
                                         |        |
                                         | update |
                                         |        |
                                         +--------+
                                           ^    |
                                           |    | 
                                       Msg |    | #(Model, Effect(Msg))
                                           |    |
                                           |    v
+------+                         +------------------------+
|      |  #(Model, Effect(Msg))  |                        |
| init |------------------------>|     Lustre Runtime     |
|      |                         |                        |
+------+                         +------------------------+
                                           ^    |
                                           |    |
                                       Msg |    | Model
                                           |    |
                                           |    v
                                         +--------+
                                         |        |
                                         | render |
                                         |        |
                                         +--------+
pub type App(model, msg)
pub type Error {
  ElementNotFound
  ComponentAlreadyRegistered
}

Constructors

  • ElementNotFound
  • ComponentAlreadyRegistered
Search Document