Hi, 

This is the plan:
There is one counter with its button which increments it by one.
There is another counter with its button which increments it by one.
And finally there is another button which increments both above counters by 
one.


Is it possible to the last button to send a message to the update function, 
which calls the increment messages of each counter ?

Something like,

update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
    case msg of
    IncrementBothCounters ->
      ( model, pleaseCallTheUpdateFunctionWithTheseMessages [ 
IncrementFirstCounter, IncrementSecondCounter ])
    
    IncrementFirstCounter ->
      ( { model | countFirst = model.countFirst + 1 }, Cmd.none)

    IncrementSecondCounter ->
      ( { model | countSecond = model.countSecond + 1 }, Cmd.none)


Tks,
Germain.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to