Elm Language Ports (JS interop)

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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.



Got any Elm Language Question?