Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* The router runs this navigate action once a new route is resolved.
* This returns a promise that must be satisfied before the render
* starts. The promise consists of all actions that each handler
* in the route declares that it needs before navigating.
* WHEN we upgrade react-router to 1.0, we should revisit this design
* @return {Promise} to satisfy all the dependencies of the route
navigate: (actionContext, payload) => {
actionContext.dispatch('CHANGE_ROUTE', payload);
var handlers = => route.handler);
var allActionDependencies = _( => h.navigateActionDependencies)).
var allPromises =
// pass the payload from this navigate action
(action) => actionContext.executeAction(action, payload)
// navigation ready once all dependent promises are satisifed
return Q.all(allPromises);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.