Communicating between MVU states
Learn how to use the Intent pattern to communicate between independent MVU states
val init : unit -> Model * Cmd<Msg>
val update : Msg -> Model -> Model * Cmd<Msg>Communicating from child to parent
val init: unit -> Model * Cmd<Msg> * Intent option
val update: Msg -> Model -> Model * Cmd<Msg> * Intent optiontype Msg =
| TextChanged of string
| Complete
type Intent =
| SaveDraft of string
| GoToNextStep
let init () =
{ ... }, Cmd.none, None
let update msg model =
match msg with
| TextChanged newValue -> { model with Text = newValue }, Cmd.none, Some (SaveDraft draft)
| Complete -> model, Cmd.none, Some GoToNextStepCommunicating between siblings
Last updated