I'm not sure what the outmessage package is that you linked to, but you 
don't need a package to manage this. An outmsg is just a messge that is 
returned from the update function, to notify the function caller of 
something important that happened internally. If you're new to elm, it's 
probably better to wire an OutMsg yourself, just so you know exactly what's 
going on with the code. If you haven't yet seen the Sortable Table Example 
<https://github.com/evancz/elm-sortable-table>, you should have a close 
look at the code. You'll see great examples of the update and view method 
returning useful messages.

On Saturday, September 17, 2016 at 1:50:26 PM UTC-4, Rupert Smith wrote:
>
> On Saturday, September 17, 2016 at 2:01:54 AM UTC+1, Erik Lott wrote:
>>
>> No, our pages make their own HTTP requests from within the page, and do 
>> not delegate the top layer to make requests. The majority of our api 
>> requests are done from within pages, and I think that's likely the case for 
>> most apps. Each of our "pages" manage their own http errors through the use 
>> of a reusable view module that displays errors in a popup modal. We COULD 
>> pass 401 errors upwards to the top layer to initiate a re-route to login, 
>> but we don't - If a 401 hasn't been caught during the initial transition to 
>> a page, it's unlikely that one is going to occur during the lifetime of a 
>> single page. If a 401 does occur during a page api request, it's simple to 
>> display a "please login" message in the  popup error modal.
>>
>> If you absolutely need to communicate all 401's upwards, just make that 
>> part of the API of your page modules - that will involve sending an 
>> 'OutMsg' from your page's "update" function.
>>
>
> Thanks. Never heard of OutMsg until now...
>
> http://package.elm-lang.org/packages/folkertdev/outmessage/1.0.2
>
> Basically achieves the same thing that I did with ports, but without the 
> need to resort to ports. 
>

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