Created
August 26, 2015 18:50
-
-
Save amitaibu/72607f51920be09e3370 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
update : Action -> Model -> (Model, Effects Action) | |
update action model = | |
case action of | |
RequestMore -> | |
( model | |
, getRandomGif model.topic | |
) | |
NewGif maybeUrl -> | |
( Model model.topic (Maybe.withDefault model.gifUrl maybeUrl) | |
, Effects.task Tick | |
) | |
Tick -> | |
( model | |
, Effects.task (Task.sleep (5 * second)) `andThen` \_ -> NewGif) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment