Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router types #23

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Router types #23

merged 2 commits into from
Dec 21, 2023

Conversation

pleek91
Copy link
Contributor

@pleek91 pleek91 commented Dec 21, 2023

Description

Fills out the Router type. Decided to leave the routeMatch method as part of the router for now to avoid making this change bigger.

Comment on lines +45 to +55
const router = {
routes: createRouteMethods(routes),
push,
replace,
forward,
back,
go,
routeMatch,
} as Router<T>
}

return router
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth pointing out. I ran into that "Type instantiation is excessively deep and possibly infinite" error here again if I did either

const router: Router<T> = { ... }

or

return { ... }

But just letting it infer the type for the router const and then returning it is fine for some reason.

@pleek91 pleek91 merged commit 4f9845c into main Dec 21, 2023
@pleek91 pleek91 deleted the router-types branch December 30, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants