a little refactoring (different CML loops have their own files now)

This commit is contained in:
2024-08-28 19:34:47 +01:00
parent 0a4de92862
commit fb9202248c
5 changed files with 34 additions and 27 deletions

View File

@@ -0,0 +1,18 @@
structure UpdateThread =
struct
open CML
local
fun loop (inputMailbox, drawMailbox, model) =
let
val inputMsg = Mailbox.recv inputMailbox
val (model, drawMsg) = AppUpdate.update (model, inputMsg)
val _ = Mailbox.send (drawMailbox, drawMsg)
in
loop (inputMailbox, drawMailbox, model)
end
in
fun run (inputMailbox, drawMailbox, initial) =
loop (inputMailbox, drawMailbox, initial)
end
end