Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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