>
> As a newbie, I struggle to grasp whether I should tap into the Cmd module, 
> and if so, how to do that.


If by "tap into the Cmd module" you mean messing around with the Native Cmd 
code, or creating your own effects manager, than no, don't reach for that - 
it's not necessary to solve your problem. Without knowing more about your 
app architecture, my first thought would be this: if you really need access 
to the websocket in both the parent and the child (and there can be 
situations where you might), extract the websocket plumbing into a module, 
and include it in these other 2 modules (your parent and child).

The thing to watch out for is storing your main business/domain records is 
multiple places throughout the app - if you catch yourself doing this, you 
should stop and take a close look at your architecture.


On Tuesday, August 30, 2016 at 6:14:26 AM UTC-4, Alessandro Mencarini wrote:
>
>
>
> On Friday, August 26, 2016 at 9:38:23 PM UTC+1, Nick H wrote:
>>
>> So I agree that Cmd itself is not suitable for this more complex version 
>> of the queue problem. But that's fine. If you feel that the way Elm is 
>> being presented, that it is encouraging (or pressuring?) us to solve every 
>> problem with commands, then maybe we need to change the text of the 
>> guide/documentation/website.
>>
>  
> Newbie's opinion here, hopefully this can steer the discussion in a 
> helpful way. 
>
> In Elm tutorial you can read this:
>
> In Elm, commands (Cmd) are how we tell the runtime to execute things that 
>> involve side effects. 
>
>
> This caused me to look into Cmd as a first reaction when trying to build 
> something where a child had to communicate state changes through websockets 
> (only present in the parent). 
> I hit a rubber wall and only found a good way of handing the situation 
> when Josh pointed me to the "OutMsg pattern" he used.
>
> As a newbie, I struggle to grasp whether I should tap into the Cmd module, 
> and if so, how to do that.
>

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