Elm LanguagePorts (JS interop)


Syntax

  • Elm (receiving): port functionName : (value -> msg) -> Sub msg
  • JS (sending): app.ports.functionName.send(value)
  • Elm (sending): port functionName : args -> Cmd msg
  • JS (receiving): app.ports.functionName.subscribe(function(args) { ... });

Remarks

Consult http://guide.elm-lang.org/interop/javascript.html from The Elm Guide to aid in understanding these examples.