Skip to content

Instantly share code, notes, and snippets.

@safronu
Last active May 9, 2020 21:24
Show Gist options
  • Save safronu/5126f63ffc218f348772304555e1fcd8 to your computer and use it in GitHub Desktop.
Save safronu/5126f63ffc218f348772304555e1fcd8 to your computer and use it in GitHub Desktop.
module RegistrationForm (component) where
import Prelude
import Halogen as H
import Halogen.HTML as HH
import Halogen.HTML.Events as HE
import Halogen.HTML.Properties as HP
type State = { enabled :: Boolean}
data Action = Toggle
component :: forall q i o m. H.Component HH.HTML q i o m
component =
H.mkComponent
{ initState
, render
, eval: H.mkEval $ H.defaultEval { handleAction = handleAction }
}
initState :: forall i. i -> State
initState _ = { enabled: false }
-- initState _ =
render :: forall m. State -> H.ComponentHTML Action () m
render _ = HH.text "Hello"
handleAction :: forall o m. Action -> H.HalogenM State Action () o m Unit
handleAction = const $ pure unit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment