Created
April 18, 2016 20:02
-
-
Save chuck0523/840f00e4337bc0a3c3406f028b1c1e7c to your computer and use it in GitHub Desktop.
This file contains 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
type Action | |
= RequestMore | |
| NewGif (Maybe String) | |
update : Action -> Model -> (Model, Effects Action) | |
update msg model = | |
case msg of | |
RequestMore -> | |
( model | |
, getRandomGif model.topic | |
) | |
NewGif maybeUrl -> | |
( Model model.topic (Maybe.withDefault model.gifUrl maybeUrl) | |
, Effects.none | |
) | |
-- getRandomGif : String -> Effects Action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment