-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling ".refresh()" from the router service #592
Comments
The reason that I'm not a fan of Let's say I have a component that can refresh a specific route, |
I have questions about how this would work with queryParams. With sticky queryParams? How is this different from calling this.transitionTo(currentRouteName)? |
I completely agree with this ☝️. Because I see the RouteInfo class as more of a "snapshot", I think that treating the refresh method the same as If we were to put the Also by allowing the use of a route name to target a specific route, you can easily make use of the currentRoute routeInfo. if you want to refresh starting up a couple parent routes, you could use From the docs:
I think that putting the method on the RouteInfo class breaks from the intent of it. The find method makes sense because it's meant to make traversing the linked list of routeInfos convenient.
This would be no different than calling |
Along the lines of currentRoute.parent.refresh, I started thinking about router.refresh(depth = 1)... not much better. Would be easy to get mixed up with implicit index routes too. I agree that a route name would be a lot less prone to confusion |
I've seen developers misusing Ember Data. Usually when they get to a point that things don't work anymore, the solution is to reload. This |
IMO it's better than having them resort to using |
@jakebixbyavalara What are some use cases for the |
Of course, I'll let @jakebixbyavalara add other use cases, but I also feel that this is just an omission and that the router service (which is already an extremely powerful piece of Ember's architecture) should get that "power". |
Just want to pitch in and say that I agree with it being cumbersome to reload non-Ember Data routes using just closure actions, and it often requires passing actions very deep in the tree, which is not great when you have to refactor. An addition to the router service seems very logical to me. |
Addressed by #631 |
Right now, refresh only exists on the route.
It'd be fantastic if we had a central place to call refresh.
Update 1
Original Text
Maybe this is something that exists on each RouteInfo that makes of the list of route infos representing the current route?
Given:
And I want to refresh just the show route, maybe I'd do:
And give that the route tree is represented as a linked list:
maybe I want to refresh just the posts route?
Thoughts?
The text was updated successfully, but these errors were encountered: