Skip to content

Commit

Permalink
fix(routing): don't log route objects after match
Browse files Browse the repository at this point in the history
These are very large because of the zod schemas so bloat console output
  • Loading branch information
UberMouse committed Feb 7, 2024
1 parent e8ba7db commit 95894b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routing/handleLocationChange/handleLocationChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function handleLocationChange(
): { events: RoutingEvent<any>[]; matchedRoute: AnyRoute } | undefined {
console.debug("[xstate-tree] Matching routes", basePath, path, search, meta);
const match = matchRoute(routes, basePath, path, search);
console.debug("[xstate-tree] Match result", match);

if (match.type === "no-matches") {
const fourOhFour: Routing404Event = {
Expand All @@ -38,6 +37,7 @@ export function handleLocationChange(
console.error("Error matching route for", location.pathname);
return;
} else {
console.log("[xstate-tree] matched route", match.event);
const matchedEvent = match.event;
matchedEvent.meta = { ...(meta ?? {}) };
(matchedEvent.meta as Record<any, any>).indexEvent = true;
Expand Down

0 comments on commit 95894b6

Please sign in to comment.