Comment up part5
This commit is contained in:
@@ -103,12 +103,13 @@ initialModel =
|
|||||||
|
|
||||||
decodeResults : String -> List SearchResult
|
decodeResults : String -> List SearchResult
|
||||||
decodeResults json =
|
decodeResults json =
|
||||||
case Json.Decode.decodeString responseDecoder json of
|
-- TODO use Json.Decode.decodeString to translate this into either:
|
||||||
Ok results ->
|
--
|
||||||
results
|
-- * the search results, if decoding succeeded
|
||||||
|
-- * an empty list if decoding failed
|
||||||
Err err ->
|
--
|
||||||
[]
|
-- see http://package.elm-lang.org/packages/elm-lang/core/4.0.0/Json-Decode#decodeString
|
||||||
|
[]
|
||||||
|
|
||||||
|
|
||||||
view : Model -> Html Msg
|
view : Model -> Html Msg
|
||||||
|
|||||||
Reference in New Issue
Block a user