2020-05-19 05:37:54 +00:00
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
import { collect } from '@ember/object/computed';
|
|
|
|
import { watchRecord } from 'nomad-ui/utils/properties/watch';
|
|
|
|
import WithWatchers from 'nomad-ui/mixins/with-watchers';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class IndexRoute extends Route.extend(WithWatchers) {
|
2020-05-19 05:37:54 +00:00
|
|
|
startWatchers(controller, model) {
|
|
|
|
if (!model) return;
|
|
|
|
|
|
|
|
controller.set('watchers', {
|
|
|
|
model: this.watch.perform(model),
|
|
|
|
});
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2020-05-19 05:37:54 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@watchRecord('plugin') watch;
|
|
|
|
@collect('watch') watchers;
|
|
|
|
}
|