Integrating commands
Learn how to use Cmd.map and Cmd.batch to compose Cmds from independent MVU states
val init: unit -> Model
val update: Msg -> Model -> Modelval init: unit -> Model * Cmd<Msg>
val update: Msg -> Model -> Model * Cmd<Msg>let update msg model =
match msg with
| Form1Msg f1 ->
let m, c = Form1.update f1 model.Form1Model
{ model with Form1Model = m }, c
| Form1Msg f2 ->
let m, c = Form2.update f2 model.Form2Model
{ model with Form2Model = m }, c // ERROR: Expected Cmd<Form1.Msg>, got Cmd<Form2.Msg>Converting a command's Msg type
Batching several Cmds together
Last updated