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

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

arturo's avatar
arturo committed
13 14 15
here :: R2.Here
here = R2.here "Gargantext.Main"

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

paint :: Maybe Element -> Effect Unit
arturo's avatar
arturo committed
20
paint Nothing  = here.error "[main] Container not found"
21
paint (Just c) = R2.render app c
arturo's avatar
arturo committed
22
  where
23
    app = App.app {}