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

3
import DOM.Simple (Element)
James Laver's avatar
James Laver committed
4
import DOM.Simple.Console (log)
Alexandre Delanoë's avatar
Alexandre Delanoë committed
5 6 7
import DOM.Simple.Document (document)
import Data.Maybe (Maybe(..))
import Data.Nullable (toMaybe)
Sudhir Kumar's avatar
Sudhir Kumar committed
8
import Effect (Effect)
James Laver's avatar
James Laver committed
9
import FFI.Simple ((...))
10
import Gargantext.Components.App (app)
11
import Gargantext.Utils.Reactix as R2
Alexandre Delanoë's avatar
Alexandre Delanoë committed
12
import Prelude (Unit, ($))
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