Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 732 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 732 Bytes

JavaScript interop with Elm

This is an example of passing messages from Elm to JavaScript and backwards.

It sends a hole () or empty Tuple to JavaScript, as a message and retrieves a numeric value.

Inspired by [Trouble Connecting Ports and Subscriptions] question

See more on the matter in the official docs for [JavaScript Interop] ports

Building the example

Since this example features port module, it is impossible to build it with elm reactor.

You have to explicitly specify the --output=index.js

$ elm make Main.elm --output=index.js