Hi Max, thanks for the reply. I'm not sure I explained myself well. This is not about subscribers, it's for sending out to the JavaScript. The function in JavaScript takes no arguments, so it doesn't make sense to send an argument through the port.
My question is mostly why does this error: port fetch : Cmd msg but I could do fetch : Cmd msg and that would compile? This kind of seems like a bug to me. I don't see why ports should have be *required* to have an argument. Maybe I'm missing something. On Sunday, June 5, 2016 at 9:28:42 PM UTC-5, Max Goldstein wrote: > > The way you've defined fetch, if you call this function on a string and > pass the resulting command as output of your update function, the string > becomes available for subscribers in JavaScript. Those subscribers might > very well do some fetching. If you want a command with no information, try > () -> Cmd msg, which I think will hand subscribers the empty array. > > One thing to notice here is that the type is *Cmd msg*, not *Cmd Msg*. > This means that the command can produce any possible value as a result of > running -- which means it actually produces no value at all. This seems > strange until you consider that [] : List a and Nothing : Maybe a. If the > values inside a thing are unconstrained, then that thing is actually empty. > > > -- 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.
