Skip to content

Commit

Permalink
lint, add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Oct 30, 2024
1 parent e0774c3 commit bd25de2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/packages/app/src/routing/RouterContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ export const createRouter = <T extends OperationType>(
hard: false,
handleError,
});
} catch {
return;
} catch (e) {
if (e instanceof Resource) {
// skip the page change if a resource is thrown
return;
}

throw e;
}

requestAnimationFrame(() => {
Expand Down Expand Up @@ -210,6 +215,7 @@ const makeGetEntryResource = <T extends OperationType>() => {
handleError?: (error: unknown) => void;
}): Resource<Entry<T>> => {
if (isReusable(location)) {
// throw the current resource (page) if it can be reused
throw currentResource;
}

Expand Down

0 comments on commit bd25de2

Please sign in to comment.