2020-07-09 09:08:47 +00:00
|
|
|
import Helper from '@ember/component/helper';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import { getOwner } from '@ember/application';
|
|
|
|
|
2020-12-08 09:27:28 +00:00
|
|
|
export default class RefreshRouteHelper extends Helper {
|
|
|
|
@service('router') router;
|
|
|
|
|
2020-07-09 09:08:47 +00:00
|
|
|
compute(params, hash) {
|
|
|
|
return () => {
|
|
|
|
const container = getOwner(this);
|
|
|
|
const routeName = this.router.currentRoute.name;
|
|
|
|
return container.lookup(`route:${routeName}`).refresh();
|
|
|
|
};
|
2020-12-08 09:27:28 +00:00
|
|
|
}
|
|
|
|
}
|