Last active
January 6, 2019 12:42
-
-
Save jonathanlking/49ed254928c64cf861225126202b6e42 to your computer and use it in GitHub Desktop.
Example for issue https://github.com/ajnsit/purescript-concur/issues/10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Concur.Core (Widget) | |
import Concur.React (HTML) | |
import Concur.React.DOM (button, text) | |
import Concur.React.Props (onClick) | |
import Concur.React.Run (runWidgetInDom) | |
import Effect (Effect) | |
import Effect.Class (liftEffect) | |
import Effect.Console (log) | |
example :: forall a. Int -> Widget HTML a | |
example x = do | |
liftEffect (log $ "example" <> show x) | |
_ <- button [onClick] [text $ "example" <> show x] | |
example x | |
example' :: forall a. Int -> Widget HTML a | |
example' x = do | |
_ <- button [onClick] [text $ "example" <> show x] | |
liftEffect (log $ "example" <> show x) | |
example' x | |
main :: Effect Unit | |
main = do | |
runWidgetInDom "root" (example 1 <> example 2) | |
-- runWidgetInDom "root" (example' 1 <> example' 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment