> but I have seen terrible bugs being introduced by improper use, caused by 
> Cmd messages being created based on model state A, and because of race 
> conditions (e.g. fetch results coming in in the meantime)
>

My assumption is a race condition here wouldn't be possible since calling 
`sendMsg MyMsg` is a synchronous action and therefore would pipe through 
the Elm runtime and back into the update function immediately 
(synchronously). That's assuming that the Elm runtime doesn't do any 
setTimeouts behind the scenes that would allow for another Msg to be sent 
to the update function before MyMsg, thus making it asynchronous.

I agree that it's possible to misuse something like the above proposal, but 
I don't feel that should prevent it from going into core Task or core Cmd. 
Synchronously sending a Msg is a valid use case that Elm core could handle, 
and it does, but with less boilerplate.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to