aboutsummaryrefslogtreecommitdiff
path: root/docs/src/app.gleam
blob: 8d72ed9282a97887b59365e351325588a3b25ffd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// IMPORTS ---------------------------------------------------------------------

import lustre
import lustre/attribute
import lustre/element.{Element}
import lustre/element/html

// MAIN ------------------------------------------------------------------------

pub fn main() -> fn(Msg) -> Nil {
  let app = lustre.simple(init, update, view)
  let assert Ok(dispatch) = lustre.start(app, "body", Nil)

  dispatch
}

// MODEL -----------------------------------------------------------------------

type Model {
  Model
}

fn init(_) -> Model {
  Model
}

// UPDATE ----------------------------------------------------------------------

pub type Msg {
  None
}

fn update(model: Model, msg: Msg) -> Model {
  model
}

// VIEW ------------------------------------------------------------------------

fn view(model: Model) -> Element(Msg) {
  html.body([], [html.h1([], [element.text("Hello, world!")])])
}