I just ended up going down the "I'll push some stuff through a port at startup" dead-end too. Glad I finally found this discussion. Where's a good place to post an enhancement request for the docs, to the effect that the "Interop" > "HTML" section might want to mention App.programWithFlags?
On Sunday, May 15, 2016 at 12:31:42 AM UTC-7, Peter Damoc wrote: > > Sending the initial data is done by calling the embed or fullscreen with > the data not by pushing it immediately after. > > The elm-TodoMVC app shows how to do this: > > https://github.com/evancz/elm-todomvc/blob/master/index.html#L15-L17 > and > https://github.com/evancz/elm-todomvc/blob/master/Todo.elm#L86-L88 > > In short, if you use `App.programWithFlags`, the init becomes a function > that receives whatever you give it from the JS (in the TodoMVC case is > Maybe Model). > You can then use this data at init time to do whatever it needs to be > done. > > > > > On Sat, May 14, 2016 at 11:22 PM, Larry Weya <[email protected] > <javascript:>> wrote: > >> I have code that embeds an eml module and send data to its port on the >> next line. >> >> var app = Elm.SearchUI.Examples.Full.embed(container); >> app.ports.fields.send([..]); >> >> This doenst seem to work but if I make the send within a setTimeout with >> even a 10ms delay. I have something similar in 0.16 that works, although >> 0.16 required default params in the embed call. >> >> -- >> 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] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > There is NO FATE, we are the creators. > blog: http://damoc.ro/ > -- 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.
