summaryrefslogtreecommitdiff
path: root/Biz/Devalloc/Node.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Devalloc/Node.hs')
-rw-r--r--Biz/Devalloc/Node.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Biz/Devalloc/Node.hs b/Biz/Devalloc/Node.hs
new file mode 100644
index 0000000..51acbf1
--- /dev/null
+++ b/Biz/Devalloc/Node.hs
@@ -0,0 +1,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)
+