_postRouteHandler(ctx, next) {
    // Scroll to the requested element if a hash is present.
    if (ctx.hash) {
      store.dispatch(ui.setFocusId(ctx.hash));
    }

    // Sync queryParams to Redux after the route has loaded, rather than before,
    // to avoid having extra queryParams update on the previously loaded
    // component.
    store.dispatch(sitewide.setQueryParams(ctx.queryParams));

    // Increment the count of navigations in the Redux store.
    store.dispatch(ui.incrementNavigationCount());

    // Clear dirty forms when entering a new page.
    store.dispatch(ui.clearDirtyForms());


    if (!this._lastContext || this._lastContext.pathname !== ctx.pathname ||
        this._hasReleventParamChanges(ctx.queryParams,
            this._lastContext.queryParams)) {
      // Reset the scroll position after a new page has rendered.
      window.scrollTo(0, 0);
    }

    // Save the context of this page to be compared to later.
    this._lastContext = ctx;
  }
/**
   * Handler that runs on every single route change, after the new page has
   * loaded.
   * @param {PageJS.Context} ctx A page.js Context containing routing state.
   * @param {function} next Passes execution on to the next registered callback.
   */
Handler that runs on every single route change, after the new page has
loaded.
Handler that runs on every single route change after the new page has loaded .
_postRouteHandler(ctx, next) {
    if (ctx.hash) {
      store.dispatch(ui.setFocusId(ctx.hash));
    }
    store.dispatch(sitewide.setQueryParams(ctx.queryParams));
    store.dispatch(ui.incrementNavigationCount());
    store.dispatch(ui.clearDirtyForms());
    if (!this._lastContext || this._lastContext.pathname !== ctx.pathname ||
        this._hasReleventParamChanges(ctx.queryParams,
            this._lastContext.queryParams)) {
      window.scrollTo(0, 0);
    }
    this._lastContext = ctx;
  }
_postRouteHandler ( ctx , next ) { if ( ctx . hash ) { store . dispatch ( ui . setFocusId ( ctx . hash ) ) ; } store . dispatch ( sitewide . setQueryParams ( ctx . queryParams ) ) ; store . dispatch ( ui . incrementNavigationCount ( ) ) ; store . dispatch ( ui . clearDirtyForms ( ) ) ; if ( ! this . _lastContext || this . _lastContext . pathname !== ctx . pathname || this . _hasReleventParamChanges ( ctx . queryParams , this . _lastContext . queryParams ) ) { window . scrollTo ( 0 , 0 ) ; } this . _lastContext = ctx ; }
Handler that runs on every single route change, after the new page has
 loaded.
Handler that runs on every single route change after the new page has loaded .
// Scroll to the requested element if a hash is present. // Sync queryParams to Redux after the route has loaded, rather than before, // to avoid having extra queryParams update on the previously loaded // component. // Increment the count of navigations in the Redux store. // Clear dirty forms when entering a new page. // Reset the scroll position after a new page has rendered. // Save the context of this page to be compared to later.