Is it possible to create a Cmd
that sends no message on completion in Elm?
Specifically, I am trying to have an element grab the focus (programmically), but I don't need to be informed of the result:
Dom.focus "element-id"
|> Task.attempt FocusReceived
...
FocusReceived result ->
model ! [] -- result ignored
Is there any way to just have the Elm "engine" not send a message after this Cmd
?
I know that my code (FocusReceived result -> model ! []
) is a no-op, but I would like the message not to be sent at all.
update
function also trigger a command to save the state to outside storage, so I wanted a way to ignore commands that have no effect on the state. Thanks. – Ezechiel