Elm Language Ports (JS interop) Immediate outgoing message on start-up in 0.17.0


Example

To send an immediate message with data to JavaScript, you have to trigger an action from your init.

init : ( Model, Cmd Msg )
init =
    ( Model 0, send SendOutgoing )


send : msg -> Cmd msg
send msg =
    Task.perform identity identity (Task.succeed msg)