{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/590","labels_url":"https://api.github.com/repos/rackt/react-router/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/590/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/590/events","html_url":"https://github.com/rackt/react-router/pull/590","id":51653037,"number":590,"title":"Allow transition hooks access to a context object you can specify when you create the router.","user":{"login":"bobpace","id":131044,"avatar_url":"https://avatars.githubusercontent.com/u/131044?v=3","gravatar_id":"","url":"https://api.github.com/users/bobpace","html_url":"https://github.com/bobpace","followers_url":"https://api.github.com/users/bobpace/followers","following_url":"https://api.github.com/users/bobpace/following{/other_user}","gists_url":"https://api.github.com/users/bobpace/gists{/gist_id}","starred_url":"https://api.github.com/users/bobpace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobpace/subscriptions","organizations_url":"https://api.github.com/users/bobpace/orgs","repos_url":"https://api.github.com/users/bobpace/repos","events_url":"https://api.github.com/users/bobpace/events{/privacy}","received_events_url":"https://api.github.com/users/bobpace/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2014-12-11T06:49:52Z","updated_at":"2015-02-16T18:30:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rackt/react-router/pulls/590","html_url":"https://github.com/rackt/react-router/pull/590","diff_url":"https://github.com/rackt/react-router/pull/590.diff","patch_url":"https://github.com/rackt/react-router/pull/590.patch"},"body":"I've been trying to make an authentication mixin that can access the state in one of my flux stores but am not using singletons that I can make available to the static methods. Would it be alright to pass a context object through to the static willTransition hook methods to allow them access to arbitrary services you might need?\r\n\r\n        var context = {...}\r\n        Router.create({routes: routes, transitionContext: context})\r\n\r\n        statics: {\r\n          willTransitionTo: function(transition) {\r\n             var loginState = transition.context.getStore(LoginStore).getState();\r\n          }\r\n        }\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/74552858","html_url":"https://github.com/rackt/react-router/pull/590#issuecomment-74552858","issue_url":"https://api.github.com/repos/rackt/react-router/issues/590","id":74552858,"user":{"login":"nicolashery","id":1306536,"avatar_url":"https://avatars.githubusercontent.com/u/1306536?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolashery","html_url":"https://github.com/nicolashery","followers_url":"https://api.github.com/users/nicolashery/followers","following_url":"https://api.github.com/users/nicolashery/following{/other_user}","gists_url":"https://api.github.com/users/nicolashery/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolashery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolashery/subscriptions","organizations_url":"https://api.github.com/users/nicolashery/orgs","repos_url":"https://api.github.com/users/nicolashery/repos","events_url":"https://api.github.com/users/nicolashery/events{/privacy}","received_events_url":"https://api.github.com/users/nicolashery/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T18:30:39Z","updated_at":"2015-02-16T18:30:39Z","body":"Thanks @bobpace! Just upgraded to your latest branch.\r\n\r\nIf anyone else was using it and wants to upgrade, make sure you remove any calls to `transition.wait` and use the callback instead, as it was deprecated in `0.12`: https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#011x---0120"}}