examples/node_modules/react-router/modules/utils/Transition.js
/**
 * Calls the willTransitionFrom hook of all handlers in the given matches
 * serially in reverse with the transition object and the current instance of
 * the route's handler, so that the deepest nested handlers are called first.
 * Calls callback(error) when finished.
 */
Calls the willTransitionFrom hook of all handlers in the given matches
serially in reverse with the transition object and the current instance of
the route's handler, so that the deepest nested handlers are called first.
Calls the willTransitionFrom hook of all handlers in the given matches serially in reverse with the transition object and the current instance of the route ' s handler so that the deepest nested handlers are called first .
function runTransitionFromHooks(transition, routes, components, callback) {
  components = reversedArray(components);
  var hooks = reversedArray(routes).map(function (route, index) {
    return function () {
      var handler = route.handler;
      if (!transition.isAborted && handler.willTransitionFrom)
        return handler.willTransitionFrom(transition, components[index]);
      var promise = transition._promise;
      transition._promise = null;
      return promise;
    };
  });
  runHooks(hooks, callback);
}
function runTransitionFromHooks ( transition , routes , components , callback ) { components = reversedArray ( components ) ; var hooks = reversedArray ( routes ) . map ( function ( route , index ) { return function ( ) { var handler = route . handler ; if ( ! transition . isAborted && handler . willTransitionFrom ) return handler . willTransitionFrom ( transition , components [ index ] ) ; var promise = transition . _promise ; transition . _promise = null ; return promise ; } ; } ) ; runHooks ( hooks , callback ) ; }
Calls the willTransitionFrom hook of all handlers in the given matches
 serially in reverse with the transition object and the current instance of
 the route's handler, so that the deepest nested handlers are called first.
Calls the willTransitionFrom hook of all handlers in the given matches serially in reverse with the transition object and the current instance of the route ' s handler so that the deepest nested handlers are called first .