Is your feature request related to a problem? Please describe.
Currently onUpdate is only given a callback and there is no way for the router to on call the callbacks based on filtration
Describe the solution you'd like
Add a second parameter that is a path filter. Then this callback with only happen if the path filter is met.
In this example, the function myFunc should only get called if the current path starts with "/mypath":
router.onUpdate(myFunc, '/mypath');
The filter could be a string or a regex to allow for better flexibility
Is your feature request related to a problem? Please describe. Currently onUpdate is only given a callback and there is no way for the router to on call the callbacks based on filtration
Describe the solution you'd like Add a second parameter that is a path filter. Then this callback with only happen if the path filter is met.
In this example, the function
myFunc
should only get called if the current path starts with"/mypath"
:The filter could be a string or a regex to allow for better flexibility