Skip to content

Instantly share code, notes, and snippets.

@arsduo
Created September 24, 2018 00:55
Show Gist options
  • Save arsduo/2076d94a8d498566d17bb5456a8df847 to your computer and use it in GitHub Desktop.
Save arsduo/2076d94a8d498566d17bb5456a8df847 to your computer and use it in GitHub Desktop.
Simple Elm Program
type alias Model =
{ videoPlaying : Bool
, quizState : QuizDataTypeWithQuestionAndAnswerInfo
}
type Msg
= PlayVideo VideoId
| QuizAnswerSelected QuestionId AnswerId
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
PlayVideo videoId ->
updateForVideoPlaying model videoId
QuizAnswerSelected questionId answerId ->
updateForAnswerSelection model questionId answerId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment