solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

Expose createPathMatcher to public

Open minht11 opened this issue 4 years ago • 1 comments

Expose createPathMatcher function. useMatch only works with current path, so you have no options if you want for example compare previous path and see if it matches.

minht11 avatar Jul 21 '21 20:07 minht11

I'm not sure about this, but I think that instead of exposing another function we should add an optional second argument to useMatch, for 2 reasons:

  • To reduce the API surface and for easier refactoring
  • It seems like createMatcher is meant to be a lower level API. Right now all useMatch does is getting the current path and call createMatcher, but that's a bug I fixed in this PR https://github.com/solidjs/solid-router/pull/213/files

orenelbaum avatar Dec 07 '22 12:12 orenelbaum