Slide 8
Slide 8 text
2019/6/19 PWANight
localhost:8080 8/19
TEAとは
Update
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
--
③ Cmd
が返したGotArticle
というMsg
と共に結果を受け取りモデル更新
GotArticle result ->
case result of
Ok articleData ->
( { model | response = Success articleData }, Cmd.none )
Err _ ->
( { model | response = Failure }, Cmd.none )
--
② GetArticle
を受け取ったらContentfulAPI
を呼び出す(Cmd
発⾏)
GetArticle slug ->
( model, Contentful.getArticle GotArticle slug )