Skip to content

Instantly share code, notes, and snippets.

@bchase
Created June 24, 2017 22:21
Show Gist options
  • Select an option

  • Save bchase/917d0204e0fadf75477f64aef8479fa1 to your computer and use it in GitHub Desktop.

Select an option

Save bchase/917d0204e0fadf75477f64aef8479fa1 to your computer and use it in GitHub Desktop.
module Main exposing (..)
type Msg
= AddVoteResponse (Result Error Model)
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
-- AddVoteResponse (Ok { girlVotes, boyVotes }) ->
-- let
-- model_ =
-- { model | girlVotes = girlVotes, boyVotes = boyVotes }
-- |> recalculate
-- in
-- model_ ! []
AddVoteResponse (Ok model_) ->
model_ |> recalculate ! []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment