Suggestion: router.reload()
See original GitHub issueFeature description
It would be nice to have an API router.reload()
or similar. Basically it would navigate to the current route.
Respecting activation strategies means that it could do nothing, create a new VM or just invoke the lifecycle again. I am unsure if passing options to force a different activation strategy (e.g. invokeLifecycle
instead of default) is useful or not.
As I am not using child routers or viewports, am I unsure what behavior would make sense for those.
Use cases
Use cases could be that you’ve performed an operation on the server (e.g. save) and the impact on your VM is complicated and you prefer to load it from scratch than try to update it.
Current solutions
Trying to use navigate
or navigateToRoute
is currently doomed to fail, because of this check I think:
https://github.com/aurelia/history-browser/blob/master/src/index.js#L191
A workaround is to pass an additional “forcing” parameter with a random value or something that changes such as time.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:23
- Comments:49 (16 by maintainers)
@bryanrsmith I think this is similar to the other issue we had where we proposed something like a
force
option to be added to the options for thenavigate
method. I’m seeing this issue come up more and more, so I think we definitely want to find a clean way to address it.I believe that there are several workaround in the comments above. This feature is waiting a community contribution for implementation.