github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/routes/csi/plugins/plugin/index.js (about)

     1  import Route from '@ember/routing/route';
     2  import { collect } from '@ember/object/computed';
     3  import { watchRecord } from 'nomad-ui/utils/properties/watch';
     4  import WithWatchers from 'nomad-ui/mixins/with-watchers';
     5  import { inject as service } from '@ember/service';
     6  
     7  export default class IndexRoute extends Route.extend(WithWatchers) {
     8    @service store;
     9  
    10    startWatchers(controller, model) {
    11      if (!model) return;
    12  
    13      controller.set('watchers', {
    14        model: this.watch.perform(model),
    15      });
    16    }
    17  
    18    @watchRecord('plugin') watch;
    19    @collect('watch') watchers;
    20  }