summaryrefslogtreecommitdiff
path: root/Biz/Devalloc/Node.hs
blob: 51acbf1c3cc244d6fb5b681650a0fbc84a65da1d (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
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecordWildCards #-}

-- : out devalloc.js
--
-- : dep clay
-- : dep ghcjs-base
-- : dep miso
-- : dep potolude
-- : dep servant
-- : dep text
module Biz.Devalloc.Node (main) where

import Alpha
import qualified Biz.Devalloc.Core as Core
import Miso

main :: IO ()
main = miso <| \currentURI -> App {model = Core.make currentURI, ..}
  where
    update = move
    view = view
    subs = []
    events = defaultEvents
    initialAction = Core.NoOp
    mountPoint = Nothing

move :: Core.Move -> Core.Form -> Effect Core.Move Core.Form
move mov form = case mov of
  Core.NoOp -> noEff form
  Core.ChangeURI u -> form <# (pushURI u >> pure Core.NoOp)