Remove the App.Button module (only served as an example).
This commit is contained in:
parent
44e4331943
commit
b3e422c38f
@ -1,34 +0,0 @@
|
|||||||
module App.Button where
|
|
||||||
|
|
||||||
import Prelude
|
|
||||||
import Halogen as H
|
|
||||||
import Halogen.HTML as HH
|
|
||||||
import Halogen.HTML.Events as HE
|
|
||||||
|
|
||||||
type State
|
|
||||||
= { count :: Int }
|
|
||||||
|
|
||||||
data Action
|
|
||||||
= Increment
|
|
||||||
|
|
||||||
component :: forall q i o m. H.Component q i o m
|
|
||||||
component =
|
|
||||||
H.mkComponent
|
|
||||||
{ initialState: \_ -> { count: 0 }
|
|
||||||
, render
|
|
||||||
, eval: H.mkEval H.defaultEval { handleAction = handleAction }
|
|
||||||
}
|
|
||||||
|
|
||||||
render :: forall cs m. State -> H.ComponentHTML Action cs m
|
|
||||||
render state =
|
|
||||||
HH.div_
|
|
||||||
[ HH.p_
|
|
||||||
[ HH.text $ "You clicked " <> show state.count <> " times" ]
|
|
||||||
, HH.button
|
|
||||||
[ HE.onClick \_ -> Increment ]
|
|
||||||
[ HH.text "Click me" ]
|
|
||||||
]
|
|
||||||
|
|
||||||
handleAction :: forall cs o m. Action → H.HalogenM State Action cs o m Unit
|
|
||||||
handleAction = case _ of
|
|
||||||
Increment -> H.modify_ \st -> st { count = st.count + 1 }
|
|
Loading…
Reference in New Issue
Block a user