{"action":"created","issue":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/278","repository_url":"https://api.github.com/repos/slamdata/purescript-halogen","labels_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/278/comments","events_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/278/events","html_url":"https://github.com/slamdata/purescript-halogen/issues/278","id":134590826,"number":278,"title":"Error Bubbling","user":{"login":"lippling","id":85933,"avatar_url":"https://avatars.githubusercontent.com/u/85933?v=3","gravatar_id":"","url":"https://api.github.com/users/lippling","html_url":"https://github.com/lippling","followers_url":"https://api.github.com/users/lippling/followers","following_url":"https://api.github.com/users/lippling/following{/other_user}","gists_url":"https://api.github.com/users/lippling/gists{/gist_id}","starred_url":"https://api.github.com/users/lippling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lippling/subscriptions","organizations_url":"https://api.github.com/users/lippling/orgs","repos_url":"https://api.github.com/users/lippling/repos","events_url":"https://api.github.com/users/lippling/events{/privacy}","received_events_url":"https://api.github.com/users/lippling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-18T14:11:49Z","updated_at":"2016-02-19T16:36:29Z","closed_at":null,"body":"Hi,\r\n\r\nI started using Purescript/Halogen a couple of days ago, but I have used Haskell before.\r\n\r\nComponent structure:\r\n```\r\n         Main\r\n      /       \\\r\nLogin           App\r\n               /    \\\r\n      Navigation     Content\r\n                      / | \\\r\n                      .....     \r\n```\r\n\r\nThe app talks to an API with an access token. When access token and refresh token are expired, the user should see the login again. So for example: a child component of the `Content` component makes an Ajax call and the response is `401`. I'd like to have one point in `Main` where I can \"catch\" all `401` errors, so I can install the `Login` component instead of `App`.\r\n\r\nIs this possible or do I have to deep `peek` every single child component that does Ajax or is there a completely different approach?\r\n\r\nThanks\r\nAlexander\r\n"},"comment":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/comments/186290975","html_url":"https://github.com/slamdata/purescript-halogen/issues/278#issuecomment-186290975","issue_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/278","id":186290975,"user":{"login":"jdegoes","id":156745,"avatar_url":"https://avatars.githubusercontent.com/u/156745?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegoes","html_url":"https://github.com/jdegoes","followers_url":"https://api.github.com/users/jdegoes/followers","following_url":"https://api.github.com/users/jdegoes/following{/other_user}","gists_url":"https://api.github.com/users/jdegoes/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegoes/subscriptions","organizations_url":"https://api.github.com/users/jdegoes/orgs","repos_url":"https://api.github.com/users/jdegoes/repos","events_url":"https://api.github.com/users/jdegoes/events{/privacy}","received_events_url":"https://api.github.com/users/jdegoes/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T16:36:29Z","updated_at":"2016-02-19T16:36:29Z","body":"> For example, if I used a free monad to for HTTP, I'd be in a bind if I then needed to make parallel requests (I think you'd also need to provide a separate free applicative for these purposes, because you can't have both a free applicative and monad).\r\n\r\nYou can, however, create a separate algebra to support parallelizing operations, which is then expressed inside free, for an overall structure of a sequential flow of parallel tasks that rejoin on every bind.\r\n\r\nOn the topic of this issue, right now, the component machinery allows you to observe child inputs, but not child outputs. Moreover, it requires parent and child share the same `g`.\r\n\r\nHowever, neither of these are necessary limitations. If we generalize this machinery (at the very leastm the first part; the second would be helpful here but is not necessary), you would be able to \"peek\" not just on inputs, but also on outputs. \r\n\r\nI feel like that could head off a good amount of complexity / anti-patterns.\r\n\r\nThoughts? /cc @garyb "}}