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

add params property like RadixRouter.lookup to RouteMatcher.matchAll #57

Open
1 task
demosofa opened this issue Jul 12, 2023 · 2 comments
Open
1 task

Comments

@demosofa
Copy link

Describe the feature

I think this is more consistent with RadixRouter.lookup as I myself was hoping for a params property. The use-case comes from the implemetation of URL's wildcard pattern where there can be multiple urls have different path parameters.

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Jul 12, 2023

Hi. Can you please elaborate more about expected new feature how API looks like?

@Hanxven
Copy link

Hanxven commented Aug 17, 2023

@pi0 Hello.

If there are two routing rules:

  • /hello/:name
  • /hello/:mine

The result matcher.matchAll('/hello/world') should return (assuming no other payload) is:

[
  { params: { name: 'world' } },
  { params: { mine: 'world' } }
]

But the current version of matchAll does not carry the params field. Therefore, for matched dynamic routes, I cannot know what the dynamic parameters are.

My current requirement is to match multiple dynamic routes and have them handled by multiple handlers at the same time. I would really appreciate it if this issue could be resolved.

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

No branches or pull requests

3 participants