question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: router.reload()

See original GitHub issue

Feature 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:open
  • Created 8 years ago
  • Reactions:23
  • Comments:49 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
EisenbergEffectcommented, Aug 29, 2015

@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 the navigate 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.

3reactions
EisenbergEffectcommented, Nov 23, 2016

I believe that there are several workaround in the comments above. This feature is waiting a community contribution for implementation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I reload a page with react-router? - Stack Overflow
1. this works if you have a cookie being deleted in an onClick event that you handles your auth state, with history.go() i...
Read more >
Reloading current route in Angular 5 / Angular 6 / Angular 7
You could invoke reload() in your router and away you went. ... Another technique that was often suggested was outright reloading the page, ......
Read more >
Client Component Hooks: useRouter - Next.js beta docs
router.refresh() : Refresh the current route and fetch new data from the server. This does not reset state like scroll position or forms,...
Read more >
Create button that refreshes route? - Ember.JS
Questions Routing ... home.js actions: { refresh: function() { this.refresh(); } },. home.hbs ... With the same route I suggested earlier:
Read more >
Difference between reboot,restart and reload.
On Cisco routers and switches the terminology is " reload " to "restart" the device. You tend to hear the term "reboot" from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found