Op dinsdag 22 november 2016 14:49:47 UTC+1 schreef Charlie Koster: > > My assumption is a race condition here wouldn't be possible since calling > `sendMsg MyMsg` is a synchronous action >
I have tried it out in elm-lang.org/try, which suggests that it is asynchronous, in a simple setup - button that sends a DoStuff message - in update, the DoStuff branch outputs DoMore - update also logs all messages - the setup also contains a basic subscription to Time, with a Tick every 10ms The log then shows that between the DoStuff message and the DoMore message, a Tick message comes in. This is an extreme example, I admit, but with subscriptions to server messages, mouseovers etc, there is no telling when messages come in. So my takeaway was: if you want something done synchronously, handle it inside a single update cycle. If the community agrees that using Cmd Msg as you suggest is a valid pattern with valid use cases, then the (simple) helper would be a useful addition to a Task (or Platform? or Platform.cmd) package. The fact that we do not agree on this, makes it an interesting discussion here. Where do others stand on this? -- 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.