Embedding the same view multiple times on a page

瀏覽次數:136 次
跳到第一則未讀訊息

Anthony Naddeo

未讀,
2017年8月15日 下午2:14:172017/8/15
收件者:Elm Discuss
Does anyone have any pointers for how to repeatedly embed an Elm view on a page, particularly from JS? The use case would be for some type of embedded widget that people can insert into their page where each instance would correspond to a different id of some type. Imagine a widget that embeds live updating twitter feeds for different users where web page owners would be able to create buttons that launch live update windows.

Peter Damoc

未讀,
2017年8月15日 下午4:09:222017/8/15
收件者:Elm Discuss
What have you tried and what problems did you encountered? 

Here are 3 counters embedded in the same page with different info passed through flags. 
https://ellie-app.com/439PSrgx4dxa1/1

Why wouldn't something like this work? 



On Tue, Aug 15, 2017 at 9:14 PM, Anthony Naddeo <anthony...@gmail.com> wrote:
Does anyone have any pointers for how to repeatedly embed an Elm view on a page, particularly from JS? The use case would be for some type of embedded widget that people can insert into their page where each instance would correspond to a different id of some type. Imagine a widget that embeds live updating twitter feeds for different users where web page owners would be able to create buttons that launch live update windows.

--
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 elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
There is NO FATE, we are the creators.
blog: http://damoc.ro/

Anthony Naddeo

未讀,
2017年8月15日 下午4:21:182017/8/15
收件者:Elm Discuss
That's actually very close to what I tried, I'm not sure what I was doing wrong. I might have left some assumptions in about how many would be on the page, but I wasn't getting any rendering.

Assuming I get that to work, what does embed actually do? Is each instance totally isolated? Does the elm runtime bootstrap itself each time? To share state, we'll have to use ports?

On Tue, Aug 15, 2017 at 1:09 PM Peter Damoc <pda...@gmail.com> wrote:
What have you tried and what problems did you encountered? 

Here are 3 counters embedded in the same page with different info passed through flags. 
https://ellie-app.com/439PSrgx4dxa1/1

Why wouldn't something like this work? 



On Tue, Aug 15, 2017 at 9:14 PM, Anthony Naddeo <anthony...@gmail.com> wrote:
Does anyone have any pointers for how to repeatedly embed an Elm view on a page, particularly from JS? The use case would be for some type of embedded widget that people can insert into their page where each instance would correspond to a different id of some type. Imagine a widget that embeds live updating twitter feeds for different users where web page owners would be able to create buttons that launch live update windows.

--
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 elm-discuss...@googlegroups.com.

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 a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/N9OQVt2YHh0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.

Peter Damoc

未讀,
2017年8月15日 下午4:31:002017/8/15
收件者:Elm Discuss
On Tue, Aug 15, 2017 at 11:21 PM, Anthony Naddeo <anthony...@gmail.com> wrote:
Assuming I get that to work, what does embed actually do? Is each instance totally isolated? Does the elm runtime bootstrap itself each time? To share state, we'll have to use ports?

To my understanding, each instance is isolated. 
I don't think there is a way to actually share state but you can keep the state in various embeds synchronized by using ports. 


回覆所有人
回覆作者
轉寄
0 則新訊息