let canvasCmd canvas = Cmd.OfFunc ( fun a -> () ) type Model = { helloText : string…
- User
let canvasCmd canvas =
Cmd.OfFunc ( fun a -> () )type Model = { helloText : string listOfEllipses : Point list
}let init () = { helloText = "letsgo 4" listOfEllipses = []}, Cmd.none
type Msg = | PointerPressed of Point | PointerMoved of Point | CanvasInitialized of Canvas
let update msg model = match msg with
| PointerPressed e -> let point = e Debug.WriteLine "press" { model with listOfEllipses = point :: model.listOfEllipses }, Cmd.none | CanvasInitialized canvas -> Debug.WriteLine "DDDDDDDDDDD canvas" let processCanvas canvas = Debug.WriteLine "EEEEE canvas" //let canvasprop = canvas. model, Cmd.none // Cmd.OfFunc processCanvasin this elmish program can you give me an example of how to write a command outside the elmish update function that will subscribe to the pointermoved event of the canvas and then add another ellipse in the list (as a feedback to see that something is happening)
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.