I need to pass a few parameters to Javascript, but for a strange reason it does not compile. I started with:
port check : String -> Cmd msg
this works fine (as taken directly from JavaScript Interop). But when I am adding another parameter
port check : Int -> String -> Cmd msg
I am getting
1| port check : Int -> String -> Cmd msg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^You are saying it should be:
Int -> String -> Platform.Cmd.Cmd msg
But you need to use the particular format described here: http://guide.elm-lang.org/effect_managers/
I solved this simply by reducing arguments back to one
type alias Bundle = (Int, String)
port check : Bundle -> Cmd msg
but that would be cleaner if I could simply do
app.ports.check.subscribe(function(arg1, arg2) {
});
Why it doesn't compile?