Incoming data from JavaScript is going through Subscriptions.
Elm side
First, we need to define an incoming port, using the following syntax:
port input : (Int -> msg) -> Sub msg
We can use Sub.batch if we have multiple subscriptions, this example will only contain one Subscription to in...