rackt/react-router — pull request #590 by bobpace (2014-12-11 06:49:52+00:00)
Title: Allow transition hooks access to a context object you can specify when you create the router.

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?

var context = {...}
Router.create({routes: routes, transitionContext: context})

statics: {
willTransitionTo: function(transition) {
var loginState = transition.context.getStore(LoginStore).getState();
}
}