Created
July 18, 2018 21:38
-
-
Save rippinrobr/e15c2a5462cf39d341e4511106375fc1 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
-- getCategoriesCommand is responsible for making the HTTP GET | |
-- call to fetch the tags. |> is a pipe operator and I'm using to create a 'pipeline'. | |
-- The Json.Decode.list tagDecoder is passed to the Http.get call as the last parameter | |
-- and is responsible for turning the JSON Array of categories into an Elm list of Categories. | |
-- The List of Categories from the decoder become the parameter of the DataRecieved Msg and | |
-- eventually become the navigation list | |
getCategoriesCommand : Cmd Msg | |
getCategoriesCommand = | |
Json.Decode.list categoryDecoder | |
|> Http.get "http://localhost:8088/categories" | |
|> Http.send DataReceived |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment