Skip to content

Instantly share code, notes, and snippets.

@martimatix
Created March 1, 2017 06:46
Show Gist options
  • Save martimatix/e78f67df64e5fa78e6526bd8539c8836 to your computer and use it in GitHub Desktop.
Save martimatix/e78f67df64e5fa78e6526bd8539c8836 to your computer and use it in GitHub Desktop.
URL Change Reactor
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
UrlChange location ->
let
( nextPhrase, nextPhrases ) =
nextLineAndCycleList model.phrases
in
{ model
| location = location
, phrase = nextPhrase
, phrases = nextPhrases
}
! []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment