Skip to content

Commit

Permalink
Promise within async function not required (#2211)
Browse files Browse the repository at this point in the history
Made a tiny modification to the README. The `promise` within the `async` function is not required.
  • Loading branch information
JamesTheHacker authored and KyleAMathews committed Sep 23, 2017
1 parent 8ce59e4 commit d017907
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions docs/docs/creating-and-modifying-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,15 @@ like the following:
// called after every page is created.
exports.onCreatePage = async ({ page, boundActionCreators }) => {
const { createPage } = boundActionCreators

return new Promise((resolve, reject) => {
// page.matchPath is a special key that's used for matching pages
// only on the client.
if (page.path.match(/^\/app/)) {
page.matchPath = "/app/:path"

// Update the page.
createPage(page)
}

resolve()
})

// page.matchPath is a special key that's used for matching pages
// only on the client.
if (page.path.match(/^\/app/)) {
page.matchPath = "/app/:path"

// Update the page.
createPage(page)
}
}
```

Expand Down

0 comments on commit d017907

Please sign in to comment.