Thank for the reply, Rupert.

My challenge is different. I want to be able to generate the needed code
using Native.
In other words, the code that mounts the component does not know the name
of the module.
It receives the implementation just like VirtualDom.program receives the
implementation of a regular Elm program.

I managed to figure out how to start an independent component and now I
moved to trying to figure out how to communicate with this component.




On Mon, Jan 9, 2017 at 12:05 PM, 'Rupert Smith' via Elm Discuss <
[email protected]> wrote:

> On Saturday, January 7, 2017 at 11:19:00 AM UTC, Peter Damoc wrote:
>>
>> Now, is it possible to start a potential Elm program and embed it in the
>> constructor or in the onAttached handler?
>>
>
> Peter, it most certainly is possible. Here is how I start up Elm in the
> webcomponents I trialled with Polymer:
>
>     attached() {
>         app = Elm.Listbox.embed(this);
>
>         this._itemsChanged(this.items, []);
>
>         this._initiallySelectedChanged(this.initiallySelected, []);
>
>         app.ports.setSelected.subscribe(items => {
>             this.selected = items;
>         });
>     }
>
> --
> 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.
>



-- 
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.

Reply via email to