Last active
May 7, 2016 22:35
-
-
Save savuori/d09a8e67e42e169ff5f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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