Slide 95
Slide 95 text
Thirdly, define your update (and note the new
type)
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
FetchError error ->
-- deal with error here in reality
NewGithubData person ->
( { model | githubPerson = Just person }, Cmd.none )
FetchGithubData ->
( model, fetchGithubData model.username )