Main.purs 555 Bytes
Newer Older
1
module Main (main) where
Abinaya Sudhir's avatar
Abinaya Sudhir committed
2

James Laver's avatar
James Laver committed
3 4 5
import Prelude (Unit, ($))
import Data.Maybe (Maybe(..))
import Data.Nullable (toMaybe)
6
import DOM.Simple (Element)
James Laver's avatar
James Laver committed
7 8
import DOM.Simple.Document (document)
import DOM.Simple.Console (log)
Sudhir Kumar's avatar
Sudhir Kumar committed
9
import Effect (Effect)
James Laver's avatar
James Laver committed
10
import FFI.Simple ((...))
11
import Gargantext.Components.App (app)
12
import Gargantext.Utils.Reactix as R2
Abinaya Sudhir's avatar
Abinaya Sudhir committed
13

14
main :: Effect Unit
15 16 17 18
main = paint $ toMaybe (document ... "getElementById" $ [ "app" ])

paint :: Maybe Element -> Effect Unit
paint Nothing = log "[main] Container not found"
19
paint (Just c) = R2.render (app {} []) c