aboutsummaryrefslogtreecommitdiff
path: root/src/app/app.gleam
blob: 760876f86c1563f4262feff56a6fb4686a0e851e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gleam/io
import gleam/string
import wechat/object.{type JsObject}

fn on_launch(o: JsObject) -> Nil {
  o |> object.stringify |> string.append("gleam app: ", _) |> io.println
}

fn on_show(_o: JsObject) -> Nil {
  Nil
}

pub fn app() -> JsObject {
  object.literal([
    #("onLaunch", on_launch),
    #("onShow", on_show),
  ])
  |> object.set("data", object.new())
}