From ee9c95499d5958833696533d4dc4bf506a557d6c Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 25 Mar 2016 22:42:04 -0700 Subject: [PATCH] Revise 2. --- stages/2/Main.elm | 17 +++++------------ stages/4/Main.elm | 3 +-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/stages/2/Main.elm b/stages/2/Main.elm index 7d5780b..f10de6a 100644 --- a/stages/2/Main.elm +++ b/stages/2/Main.elm @@ -91,26 +91,19 @@ viewSearchResult address result = ] [ text result.name ] , button - -- TODO add an onClick handler that sends a HideById action + -- TODO add an onClick handler that sends a HIDE_BY_ID action [ class "hide-result" ] [ text "X" ] ] type alias Action = - { actionType : String - , payload : Int + { -- TODO implement this type alias } update : Action -> Model -> Model update action model = - if action.actionType == "HIDE_BY_ID" then - let - -- TODO build a new model without the given ID present anymore. - newModel = - model - in - newModel - else - model + -- TODO if we receive a HIDE_BY_ID action, + -- build a new model without the given ID present anymore. + model diff --git a/stages/4/Main.elm b/stages/4/Main.elm index cf1ac7a..99c8f96 100644 --- a/stages/4/Main.elm +++ b/stages/4/Main.elm @@ -155,8 +155,7 @@ update action model = HideById idToHide -> let newResults = - model.results - |> List.filter (\{ id } -> id /= idToHide) + List.filter (\{ id } -> id /= idToHide) model.results newModel = { model | results = newResults }