While learning Elm, have you found yourself blocked at some point by a chunk of knowledge/Howto slightly too large? If you managed to ingest it by successive trials and errors, what kind of tutorial would have eased your learning session, and what is your background?
Finally, does the community has already built something like Built With Elm but for external learning resources?
I’m asking because I would like to contribute in some way
Have a nice day!
Elm was my first functional programming language. The only thing that confused me a lot was how to use ports.
Thanks for your answer
= ReceivedInt Int
port toJs : Int -> Cmd msg
port toElm : (Int -> msg) -> Sub msg
It would have been better if I understood the role of the
toJs takes an
Int and creates a
Cmd msg that sends the value to js when you return it from
toElm takes a function that converts an
msg and creates a
Sub msg that allows you to receive the values sent from js. It creates a separate function on the js side that allows js code to send a value through this port when you return it from
In other words,
Msg value. I understood the role of
toJs, but not
toElm. I saw it as a function that is like
(Int -> msg) is
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.