Skip to content

Instantly share code, notes, and snippets.

@savuori
Last active May 7, 2016 22:35
Show Gist options
  • Save savuori/d09a8e67e42e169ff5f1 to your computer and use it in GitHub Desktop.
Save savuori/d09a8e67e42e169ff5f1 to your computer and use it in GitHub Desktop.
module StartAppTest where
import Html exposing (text, Html)
import StartApp
import Effects exposing (Effects)
import Time
import Signal exposing (Address)
type alias Model = Float
type Action = NewTime Float
init : ( Model, Effects a )
init = ( 0.0, Effects.none)
update : Action -> Model -> (Model, Effects a)
update action model =
case action of
NewTime t
-> (t, Effects.none)
view : Address Action -> Model -> Html
view address model = text (toString model)
timeUpdate : Signal Action
timeUpdate = Signal.map NewTime (Time.every Time.second)
app = StartApp.start { init = init
, view = view
, update = update
, inputs = [timeUpdate]
}
main = app.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment