On Friday, September 16, 2016 at 11:45:44 AM UTC+1, Rupert Smith wrote: > > > On Friday, September 16, 2016 at 10:13:01 AM UTC+1, Rupert Smith wrote: >> >> On Friday, September 16, 2016 at 1:32:06 AM UTC+1, art yerkes wrote: >>> >>> If your login page can send a message to a parent frame, you can use >>> Dom.LowLevel.onWindow to receive it in elm. This appeared in 0.17 and is >>> neat. >>> >> I think I am going to try the solution from the "Inter-Component Communication in 0.17" thread. Which is to create a pairs of messaging ports. One end of the pair will reside privately inside the Auth module, and will receive requests to perform these auth operations defined in another port module to be imported wherever it is needed:
login : AuthRequest -> Cmd msg logout : Cmd msg -- to logout on the server notauthorized : Cmd msg -- to set state to logged out whenever 401 Then by importing that port module anywhere in the application can reach for these global actions. They are all fire and forget actions, if they work then the log in state will flip and there is another function to query 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
