Last active
July 18, 2018 21:52
-
-
Save rippinrobr/b8a49a94a3fa08c2fb6921877df8afbc to your computer and use it in GitHub Desktop.
The case matches that pertain to retrieving the categories
This file contains hidden or 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 drives the changes in the UI and interaction with the server. | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
DataReceived (Ok categories) -> | |
({ model | categories = categories, errorMsg = Nothing }, Cmd.none) | |
DataReceived (Err httpError) -> | |
({ model | errorMsg = Just (createErrorMessage httpError) }, Cmd.none) | |
... pretend the rest of the case options are here ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment