{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/router/issues/328","repository_url":"https://api.github.com/repos/aurelia/router","labels_url":"https://api.github.com/repos/aurelia/router/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/router/issues/328/comments","events_url":"https://api.github.com/repos/aurelia/router/issues/328/events","html_url":"https://github.com/aurelia/router/issues/328","id":148907300,"number":328,"title":"Observables in Router Activation Lifecycle","user":{"login":"Ixonal","id":1368543,"avatar_url":"https://avatars.githubusercontent.com/u/1368543?v=3","gravatar_id":"","url":"https://api.github.com/users/Ixonal","html_url":"https://github.com/Ixonal","followers_url":"https://api.github.com/users/Ixonal/followers","following_url":"https://api.github.com/users/Ixonal/following{/other_user}","gists_url":"https://api.github.com/users/Ixonal/gists{/gist_id}","starred_url":"https://api.github.com/users/Ixonal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ixonal/subscriptions","organizations_url":"https://api.github.com/users/Ixonal/orgs","repos_url":"https://api.github.com/users/Ixonal/repos","events_url":"https://api.github.com/users/Ixonal/events{/privacy}","received_events_url":"https://api.github.com/users/Ixonal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-17T00:54:51Z","updated_at":"2016-04-27T04:36:43Z","closed_at":null,"body":"I was thinking, it would be nice to have behavior similar to that of Promises in the activate hook, but for Observables (https://github.com/zenparsing/es-observable), with the whole not showing until the first value comes through. \r\n\r\nI figure it'd be something similar to this...\r\n```javascript\r\nlet result = context.activate();\r\nif(result && result.then instanceof Function) {\r\n  //existing promise stuff\r\n} else if(result && result.subscribe instanceof Function) {\r\n  result.subscribe({\r\n    next: (val, sub) => {\r\n      sub.unsubscribe();\r\n      completeActivate();\r\n    }\r\n  }); \r\n} else {\r\n  //existing synchronous value stuff here\r\n}\r\n```\r\n\r\nAdmittedly, the unsubscribe part would require a modification to the spec to allow the subscription to be undone in the case of a synchronous first value. (https://github.com/zenparsing/es-observable/issues/83). Any thoughts?"},"comment":{"url":"https://api.github.com/repos/aurelia/router/issues/comments/214967821","html_url":"https://github.com/aurelia/router/issues/328#issuecomment-214967821","issue_url":"https://api.github.com/repos/aurelia/router/issues/328","id":214967821,"user":{"login":"Ixonal","id":1368543,"avatar_url":"https://avatars.githubusercontent.com/u/1368543?v=3","gravatar_id":"","url":"https://api.github.com/users/Ixonal","html_url":"https://github.com/Ixonal","followers_url":"https://api.github.com/users/Ixonal/followers","following_url":"https://api.github.com/users/Ixonal/following{/other_user}","gists_url":"https://api.github.com/users/Ixonal/gists{/gist_id}","starred_url":"https://api.github.com/users/Ixonal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ixonal/subscriptions","organizations_url":"https://api.github.com/users/Ixonal/orgs","repos_url":"https://api.github.com/users/Ixonal/repos","events_url":"https://api.github.com/users/Ixonal/events{/privacy}","received_events_url":"https://api.github.com/users/Ixonal/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T04:36:43Z","updated_at":"2016-04-27T04:36:43Z","body":"I'll look into it in a few days."}}