Response utilities for Elm Architecture. Build responses from tasks, pipe them, map over.
Canonical usage: construct a result from model and cmd.
Construct a response from a model and task.
Construct a result from model and cmd, flipped for piping:
{ model | foo = bar }
|> withCmd someCmdConstruct a result from model and multiple cmds, flipped for piping:
{ model | foo = bar }
|> withCmds [ someCmd1, someCmd1 ]Construct a result from model and task, flipped for piping:
{ model | foo = bar }
|> withTask someTaskConstruct a result from model without cmd, flipped for piping:
{ model | foo = bar }
|> withNoneSynonym for withNone (for those with a personal preference).
pure { model | foo = bar }Map over model.
Map over cmd.
Map over model and cmd.
Sequence one update after another.
update1 : Model -> Response Model (Cmd Msg)
update2 : Model -> Response Model (Cmd Msg)
update3 : Model -> Response Model (Cmd Msg)
update1 model
|> andThen update2
|> andThen update3
A response is an updated model and some cmd.