diff options
author | Joris | 2021-01-03 13:40:40 +0100 |
---|---|---|
committer | Joris | 2021-01-03 13:54:20 +0100 |
commit | 11052951b74b9ad4b6a9412ae490086235f9154b (patch) | |
tree | 64526ac926c1bf470ea113f6cac8a33158684e8d /client/src/Main.hs | |
parent | 371449b0e312a03162b78797b83dee9d81706669 (diff) |
Rewrite in Rust
Diffstat (limited to 'client/src/Main.hs')
-rw-r--r-- | client/src/Main.hs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/client/src/Main.hs b/client/src/Main.hs deleted file mode 100644 index c71b0f0..0000000 --- a/client/src/Main.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Main - ( main - ) where - -import qualified Data.Aeson as Aeson -import qualified Data.ByteString.Lazy as LB -import qualified Data.JSString.Text as Dom -import qualified Data.Text.Encoding as T -import qualified JSDOM as Dom -import qualified JSDOM.Generated.HTMLElement as Dom -import qualified JSDOM.Generated.NonElementParentNode as Dom -import JSDOM.Types (HTMLElement (..), JSM, - JSString) -import qualified JSDOM.Types as Dom -import Prelude hiding (error, init) - -import Common.Model (Init) -import qualified Common.Msg as Msg - -import qualified View.App as App - -main :: JSM () -main = do - initResult <- readInit - App.widget initResult - -readInit :: JSM (Maybe Init) -readInit = do - document <- Dom.currentDocumentUnchecked - initNode <- Dom.getElementById document ("init" :: JSString) - - case initNode of - Just node -> do - text <- Dom.textFromJSString <$> Dom.getInnerText (Dom.uncheckedCastTo HTMLElement node) - return $ case Aeson.decode (LB.fromStrict . T.encodeUtf8 $ text) of - Just init -> init - Nothing -> Nothing - _ -> - return Nothing |