Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created April 18, 2016 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/840f00e4337bc0a3c3406f028b1c1e7c to your computer and use it in GitHub Desktop.
Save chuck0523/840f00e4337bc0a3c3406f028b1c1e7c to your computer and use it in GitHub Desktop.
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