{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue-router/issues/251","labels_url":"https://api.github.com/repos/vuejs/vue-router/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-router/issues/251/comments","events_url":"https://api.github.com/repos/vuejs/vue-router/issues/251/events","html_url":"https://github.com/vuejs/vue-router/issues/251","id":118742379,"number":251,"title":"Ability to execute code \"really\" `afterEach`","user":{"login":"paulstraw","id":117288,"avatar_url":"https://avatars.githubusercontent.com/u/117288?v=3","gravatar_id":"","url":"https://api.github.com/users/paulstraw","html_url":"https://github.com/paulstraw","followers_url":"https://api.github.com/users/paulstraw/followers","following_url":"https://api.github.com/users/paulstraw/following{/other_user}","gists_url":"https://api.github.com/users/paulstraw/gists{/gist_id}","starred_url":"https://api.github.com/users/paulstraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulstraw/subscriptions","organizations_url":"https://api.github.com/users/paulstraw/orgs","repos_url":"https://api.github.com/users/paulstraw/repos","events_url":"https://api.github.com/users/paulstraw/events{/privacy}","received_events_url":"https://api.github.com/users/paulstraw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vuejs/vue-router/labels/suggestion","name":"suggestion","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/vuejs/vue-router/milestones/1","html_url":"https://github.com/vuejs/vue-router/milestones/0.8.0","labels_url":"https://api.github.com/repos/vuejs/vue-router/milestones/1/labels","id":1498408,"number":1,"title":"0.8.0","description":"","creator":{"login":"yyx990803","id":499550,"avatar_url":"https://avatars.githubusercontent.com/u/499550?v=3","gravatar_id":"","url":"https://api.github.com/users/yyx990803","html_url":"https://github.com/yyx990803","followers_url":"https://api.github.com/users/yyx990803/followers","following_url":"https://api.github.com/users/yyx990803/following{/other_user}","gists_url":"https://api.github.com/users/yyx990803/gists{/gist_id}","starred_url":"https://api.github.com/users/yyx990803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyx990803/subscriptions","organizations_url":"https://api.github.com/users/yyx990803/orgs","repos_url":"https://api.github.com/users/yyx990803/repos","events_url":"https://api.github.com/users/yyx990803/events{/privacy}","received_events_url":"https://api.github.com/users/yyx990803/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-01-11T22:28:07Z","updated_at":"2016-01-11T22:44:16Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-11-25T01:49:45Z","updated_at":"2016-01-17T08:38:27Z","closed_at":null,"body":"I might be totally missing something here, but it seems like in the following setup, there's no (good) way to \"really\" find out when each transition has completed (for instance, to have global loading indicators).\r\n\r\n``` javascript\r\nvar Ajaxy = Vue.extend({\r\n\ttemplate: '<div>Some ajaxy things happen in here, supposedly.</div>',\r\n\troute: {\r\n\t\tactivate: function(transition) {\r\n\t\t\treturn this.$http.get 'a-page', function(res) {\r\n\t\t\t\tthis.data = res;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar router = new VueRouter();\r\n\r\nrouter.map({\r\n\t'': {\r\n\t\tcomponent: Foo\r\n\t},\r\n\t'ajaxy': {\r\n\t\tcomponent: Ajaxy\r\n\t}\r\n});\r\n\r\nrouter.beforeEach(function(transition) {\r\n\trouter.app.loading = true;\r\n\ttransition.next();\r\n});\r\n\r\nrouter.afterEach(function() {\r\n\t// this fires before the component's route `activate` is resolved'\r\n\trouter.app.loading = false;\r\n});\r\n```\r\n\r\nI understand this is the currently expected behavior, but it would be super useful to be able to have a \"true\" after. I just had a really quick look, but if I'm not mistaken, it should be relatively easy to drop something into [_postTransition](https://github.com/vuejs/vue-router/blob/09af0b297a3b4b4b90d4c91eb635720158d13f27/src/index.js#L507) that works basically the same as when the `_afterEachHooks` are called in `_onTransitionValidated`. This could possibly be exposed as `postEach`? I'd be happy to take care of this and submit a PR, or however you want it handled!"},"comment":{"url":"https://api.github.com/repos/vuejs/vue-router/issues/comments/172300642","html_url":"https://github.com/vuejs/vue-router/issues/251#issuecomment-172300642","issue_url":"https://api.github.com/repos/vuejs/vue-router/issues/251","id":172300642,"user":{"login":"anishdcruz94","id":14172452,"avatar_url":"https://avatars.githubusercontent.com/u/14172452?v=3","gravatar_id":"","url":"https://api.github.com/users/anishdcruz94","html_url":"https://github.com/anishdcruz94","followers_url":"https://api.github.com/users/anishdcruz94/followers","following_url":"https://api.github.com/users/anishdcruz94/following{/other_user}","gists_url":"https://api.github.com/users/anishdcruz94/gists{/gist_id}","starred_url":"https://api.github.com/users/anishdcruz94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anishdcruz94/subscriptions","organizations_url":"https://api.github.com/users/anishdcruz94/orgs","repos_url":"https://api.github.com/users/anishdcruz94/repos","events_url":"https://api.github.com/users/anishdcruz94/events{/privacy}","received_events_url":"https://api.github.com/users/anishdcruz94/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T08:38:27Z","updated_at":"2016-01-17T08:38:27Z","body":"1+"}}