It’s always a good idea to have a look at the FAQ first.
https://elm-community.github.io/elm-faq/17.html#how-do-i-generate-a-new-message-as-a-command
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ah yes thank you for that, it is indeed good to know that I have not missed anything substantive with regards to the two possible approaches to propagating generated messages.
The `update-extra` library helps make the case I described as "messy" a little less so, but that approach has other issues - e.g. internally-generated messages are always handled before other pending messages, potentially resulting in an infinite loop or stack overflow, depending on implementation.
Do you have any thoughts about encapsulating the alternative approach, also described in the FAQ entry, as a function in a new `cmd-extra` library as I have done?
Cheers,
Luke
Do you have any thoughts about encapsulating the alternative approach, also described in the FAQ entry, as a function in a new
cmd-extralibrary as I have done?
I think it’s a fine thing to do. But I think succeed would be a better name than return. And that each of the definitions from the FAQ page would be a better choice for the implementation.
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/_qDpS2wxccE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
I considered
succeed, but I think it’s a bit misleading since there is no corresponding notion of failure.
Just message : msg -> Cmd msg, then?