in this case, we should forward to a new page without changing the URL. Since we are already
in an async callback, we should schedule a new handlePage with the new page constructor and return
from this call.
setTimeout(() => this.handlePage(handleRouteResult.page, request, type), 0);
return;
}
this.emit('navigateDone', null, page, request.getUrl(), type);
}).catch(err => {
logger.error("Error while handling route", err);
this.emit('navigateDone', {status: 500}, page, request.getUrl(), type);
});
}
_addPageMiddlewareToArray(pages, array) {
if (!pages) return;
pages.forEach((page) => {
if (page.middleware) {
this._addPageMiddlewareToArray(page.middleware(), array);
}
array.push(page);
});
}
getState () {
return {
loading: this._loading,
route: this._currentRoute,
}
}
getCurrentRoute () {
return this._currentRoute;
}
getLoading () {
return this._loading;
}
startRoute (route, request, type) {