Commands
type Model = { TimerOn: bool }
type Message =
| TimerToggled of bool
let init () = { TimerOn = false }
let update msg model =
match msg with
| TimerToggled on -> { model with TimerOn = on }Commands
let timerCmd =
async { do! Async.Sleep 200
return TimedTick }
|> Cmd.ofAsyncMsgTriggering Commands on Initialization
Triggering Commands as Messages are Processed
Triggering Commands from External Events
Threading and Long-running Operations
Optional commands
Web requests in a command
Platform-specific dispatch
Last updated