The exit handler is ambigous. Given the following routes
router
.get('/posts/:page?', handler)
.exit('/posts/:page?', exitHandler);
If I navigate from /posts/1 to /posts/2, should the exitHandler run?
The page is changing but the overall url structure is not.
A good solution can be to add a third parameter to .exit accepting options. One option can be strict and by default is false.
If false the behavior is that exit is run when the url changes, without any further check.
if true the exit handler run only if the next url is not a match for the exit path.
The exit handler is ambigous. Given the following routes
If I navigate from
/posts/1to/posts/2, should theexitHandlerrun?The page is changing but the overall url structure is not.
A good solution can be to add a third parameter to
.exitaccepting options. One option can bestrictand by default is false.If
falsethe behavior is that exit is run when the url changes, without any further check.if
truethe exit handler run only if the next url is not a match for the exit path.