Skip to content

Instantly share code, notes, and snippets.

@mjhoy
Last active October 24, 2016 16:28
Show Gist options
  • Save mjhoy/2baeb05a12acd8ddc1a582f821ac5fad to your computer and use it in GitHub Desktop.
Save mjhoy/2baeb05a12acd8ddc1a582f821ac5fad to your computer and use it in GitHub Desktop.
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