migrated to halogen 0.6
parent
cd6226ff80
commit
7abfa4f04b
|
@ -10,6 +10,6 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"purescript-console": "^0.1.0",
|
"purescript-console": "^0.1.0",
|
||||||
"purescript-halogen": "^0.5.14"
|
"purescript-halogen": "^0.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Control.Monad.Eff (Eff())
|
||||||
import Control.Monad.Eff.Exception (throwException)
|
import Control.Monad.Eff.Exception (throwException)
|
||||||
|
|
||||||
import Halogen
|
import Halogen
|
||||||
import Halogen.Util (appendToBody, onLoad)
|
import Halogen.Util (awaitBody)
|
||||||
import qualified Halogen.HTML.Indexed as H
|
import qualified Halogen.HTML.Indexed as H
|
||||||
import qualified Halogen.HTML.Events.Indexed as E
|
import qualified Halogen.HTML.Events.Indexed as E
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ initialState :: State
|
||||||
initialState = { on: false }
|
initialState = { on: false }
|
||||||
|
|
||||||
ui :: forall g. (Functor g) => Component State Query g
|
ui :: forall g. (Functor g) => Component State Query g
|
||||||
ui = component render eval
|
ui = component { render, eval }
|
||||||
where
|
where
|
||||||
|
|
||||||
render :: State -> ComponentHTML Query
|
render :: State -> ComponentHTML Query
|
||||||
|
@ -45,5 +45,5 @@ ui = component render eval
|
||||||
|
|
||||||
main :: Eff (HalogenEffects ()) Unit
|
main :: Eff (HalogenEffects ()) Unit
|
||||||
main = runAff throwException (const (pure unit)) $ do
|
main = runAff throwException (const (pure unit)) $ do
|
||||||
app <- runUI ui initialState
|
body <- awaitBody
|
||||||
onLoad $ appendToBody app.node
|
runUI ui initialState body
|
||||||
|
|
Loading…
Reference in New Issue