Skip to content
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

add refresh method to router service #631

Merged
merged 8 commits into from
Oct 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions text/0000-refresh-method-for-router-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- Start Date: 2020-05-23
- Relevant Team(s): Ember.js
- RFC PR: (after opening the RFC PR, update this with a link to it and update the file name)
- Tracking: (leave this empty)

# RouterService#refresh

## Summary

> Add a refresh method to the router service that calls refresh on the current route.
Gaurav0 marked this conversation as resolved.
Show resolved Hide resolved

## Motivation

> We want to be able to refresh the current route without relying on the send api.
Gaurav0 marked this conversation as resolved.
Show resolved Hide resolved

## Detailed design

```
class RouterService {
refresh() {
this.owner.lookup(`route:${this.currentRouteName}`).refresh();
Gaurav0 marked this conversation as resolved.
Show resolved Hide resolved
}
}
```

## How we teach this

> Documentation will be added to the method.
Gaurav0 marked this conversation as resolved.
Show resolved Hide resolved

## Drawbacks

> This is a slight increase in API surface area.

## Alternatives

> We could provide a direct link to the current route via the router service.
Gaurav0 marked this conversation as resolved.
Show resolved Hide resolved