Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Nov 27, 2014
1 parent 9da96b4 commit 08e9828
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/api/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Router.run(routes, function (Handler) {
});
```

Sample data fetching using `state.matches`. Check out the
Sample data fetching using `state.routes`. Check out the
[async-data][2] example.

```js
Expand All @@ -109,12 +109,12 @@ var SampleHandler = React.createClass({
Router.run(routes, Router.HistoryLocation, function (Handler, state) {

// create the promises hash
var promises = state.matches.filter(function (match) {
var promises = state.routes.filter(function (route) {
// gather up the handlers that have a static `fetchData` method
return match.route.handler.fetchData;
}).reduce(function (promises, match) {
return route.handler.fetchData;
}).reduce(function (promises, route) {
// reduce to a hash of `key:promise`
promises[match.route.name] = match.route.handler.fetchData(state.params)
promises[route.name] = route.handler.fetchData(state.params);
return promises;
}, {});

Expand Down

0 comments on commit 08e9828

Please sign in to comment.