a little refactoring (different CML loops have their own files now)
This commit is contained in:
18
imperative-shell/update-thread.sml
Normal file
18
imperative-shell/update-thread.sml
Normal 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
|
||||
Reference in New Issue
Block a user