Last active
October 24, 2016 16:28
-
-
Save mjhoy/2baeb05a12acd8ddc1a582f821ac5fad to your computer and use it in GitHub Desktop.
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 Test where | |
import Prelude | |
import Thermite as T | |
import Control.Monad.Eff.Class (liftEff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
import Control.Monad.Trans (lift) | |
type State = { i :: Int } | |
data Action = MyAction | |
type Effects eff = (console :: CONSOLE | eff) | |
mySimpleSpec :: forall props eff. T.Spec (Effects eff) State props Action | |
mySimpleSpec = T.simpleSpec perform render | |
where | |
render d _ s _ = [] | |
perform :: T.PerformAction (Effects eff) State props Action | |
perform MyAction _ _ = do | |
lift $ liftEff $ log "testing!" | |
void $ T.cotransform $ \s -> s { i = s.i + 1 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment