ccapndave/elm-update-extra/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Update.Extra

Convenience functions for working with effects in Elm

pipeUpdate : ( m, Cmd a ) -> (m -> ( m, Cmd a )) -> ( m, Cmd a )

A function allowing you to compose calls to update. Most useful when used in its infix form to make an update pipeline.

import Update.Extra.Infix exposing ((:>))


update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
  ComposedMsg ->
    (model, Cmd.none)
      :> update AnotherMsg
      :> update YetAnotherMsg
      :> update SubComponent.SomeMsg