aboutsummaryrefslogtreecommitdiff
path: root/src/main.ml
blob: 003880b19c3395fd7dbe5178549690bec5eeb1a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
type view = Config of Config.config | Timer of Config.config

let () =
  let html = Document.querySelectorUnsafe "html" in
  let main = Document.querySelectorUnsafe "main" in
  let rec showView v =
    Animation.replaceChild html main (fun _ ->
        match v with
        | Config config ->
            ConfigView.render config (fun config -> showView (Timer config))
        | Timer config ->
            TimerView.render config (fun config -> showView (Config config)))
  in
  showView (Config Config.init)