Closed zlepper closed 7 years ago
@zlepper
// Using pushState
router.navigate(router.state.value);
However, if you're using a basic hashchange router, it's less straightforward. In order for Grapnel to remain unobtrusive, it's not going to trigger the window's hashchange event again. What you technically should do is retrigger it. But another option would be to retrigger your router's hashchange event, which will work, but may cause some issues when using multiple routers.
// Using hashchange -- unobtrusive
window.dispatchEvent(new HashChangeEvent('hashchange'));
// Using hashchange -- may cause issues
router.navigate(router.state.value).trigger('hashchange');
Is there a way to retrigger the current route, so all middleware and actual route will be reloaded?
In most routers you can do this simply by doing
router.navigate(currentRoute)
, however that doesn't seem to trigger navigation again in grapnel, any way this can be done that i'm completely missing?I have also tried doing
router.trigger('navigate')
, this didn't help either.