Skip to content

Instantly share code, notes, and snippets.

@joonazan
Created October 2, 2016 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joonazan/5b7c19c6f59c78c597d9e60ad0ecd32f to your computer and use it in GitHub Desktop.
Save joonazan/5b7c19c6f59c78c597d9e60ad0ecd32f to your computer and use it in GitHub Desktop.
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
import Html
import Html.App
import Child exposing (Message(..))
main = Html.App.beginnerProgram
{ update = update
, model = Child.init
, view = \model -> Html.text "hello"
}
type Message
= MyMessage
| ChildMessage Child.Message
update message model =
case message of
MyMessage -> model
ChildMessage InterestingMessage -> model
ChildMessage x -> Child.update x model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment