Elm Language Ports (JS interop) Overview


A module, that is using Ports should have port keyword in it's module definition.

port module Main exposing (..)

It is impossible to use ports with Html.App.beginnerProgram, since it does not allow using Subscriptions or Commands.

Ports are integrated in to update loop of Html.App.program or Html.App.programWithFlags.


program and programWithFlags in elm 0.18 are inside the package Html instead of Html.App.