I'm getting an odd error when I try to make a port. It doesn't take any 
arguments, just fetches something when a button is clicked.

port fetch : Cmd msg

but I get an error:

Port `fetch` has an invalid type.


47| port fetch : Cmd msg

    ^^^^^^^^^^^^^^^^^^^^

You are saying it should be:


    Platform.Cmd.Cmd msg


But you need to use the particular format described here:

<http://guide.elm-lang.org/effect_managers/>


If I add an arbitrary argument, like so:


port fetch : String -> Cmd msg

it compiles just fine! 


What am I missing here? 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to