Hi I am new to Elm and have been playing around with it for a bit over a 
week and really like the idea.  I am trying to figure out how to do nested 
components properly.

I have successfully nested the 
clock http://guide.elm-lang.org/architecture/effects/time.html and it is 
working fine.

Now I am trying to create a nested component 
of http://guide.elm-lang.org/interop/javascript.html .  I got the example 
working, then refactored it into a nested component.

I have it 
here 
https://github.com/JonathanDDuncan/elm-webpack-starter/tree/3122bb6127546b49be023b69c35a868fe3c1f541
 
 it is the next compilable version. But it doesn't work.  It's like as if 
the check subscription on the JavaScript side isn't firing.

For fun I tried to inline the component back again to see if I could get an 
intermediary place where it started working again and ended up with almost 
the same code I started out with before.  It compiles and worked fine.

It is 
here 
https://github.com/JonathanDDuncan/elm-webpack-starter/tree/cb39d1d79e5fa8231459a333b8f9f31dc04d84ce


I am guessing either Elm doesn't like 
1) Components calling port code 
2) It doesn't like nested messages like JSInterop JSInterop.Types.Msg 
calling ports or 

3) I've something wrong with my  code for nesting subscriptions when 
calling ports, yet it works fine for other effects. 

subscriptions : Types.Model -> Sub Types.Msg
subscriptions model =
   Sub.batch
       [JSInterop.State.subscriptions model.jsInterop |> Sub.map JSInterop
       ]

4) Or something else, that I haven't thought about.


I am hoping some of you more experienced Elm programmers will be able to 
point me in the right direction.  Thanks.

Jonathan

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

Reply via email to