You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case would be to re-dispatch if a user is already on a url that matches the route you just added to page.js but your code to add the handler ran after page.js started. In other threads the solution suggested has been to perform a page.stop() followed by page.start().
This works, but in a very specific situation it fails (at least for me). Here's a psuedo implementation:
page('/myroute/*',(context,next)=>{
if(next)next();
});
page.start()
page('/myroute/other/*',(context,next)=>{
if(next)next();
});
page.stop();
page.start();
page('/myroute/other/beans');
// this will reload the page at the url mydomain/myroute/other instead of updating the url
Not sure as to why this is happening, something not being cleaned up when start() is subsequent to stop() maybe?
I solved by removing if(next)next(); from my second handler, but that shouldn't be necessary.
The text was updated successfully, but these errors were encountered:
The use case would be to re-dispatch if a user is already on a url that matches the route you just added to page.js but your code to add the handler ran after page.js started. In other threads the solution suggested has been to perform a page.stop() followed by page.start().
This works, but in a very specific situation it fails (at least for me). Here's a psuedo implementation:
Not sure as to why this is happening, something not being cleaned up when start() is subsequent to stop() maybe?
I solved by removing if(next)next(); from my second handler, but that shouldn't be necessary.
The text was updated successfully, but these errors were encountered: