diff --git a/README.md b/README.md index b095f692..efc5ae24 100644 --- a/README.md +++ b/README.md @@ -282,21 +282,13 @@ If you are no longer want to listen to that event, you can simply unset the even Router.onRouteChangeStart = null ``` -##### Cancelled (Abort) Routes - -Sometimes, you might want to change a route before the current route gets completed. Current route may be downloading the page or running `getInitialProps`. -In that case, we abort the current route and process with the new route. - -If you need, you could capture those cancelled routes via `routeChangeError` router event. See: +If a route load is cancelled (for example by clicking two links rapidly in succession), `routeChangeError` will fire. The passed `err` will contained a `cancelled` property set to `true`. ```js Router.onRouteChangeError = (err, url) => { if (err.cancelled) { - console.log(`Route to ${url} is cancelled!`) - return + console.log(`Route to ${url} was cancelled!`) } - - // Some other error } ```