open-nomad/ui/app/routes/clients/index.js
Michael Lange 2282f3243a Use willTransition instead of deactivate to cancel requests
deactivate happens _after_ the new route's model hook, which
results in the possibility of canceling new requests right
after they are made rather than existing open connections
2018-03-05 09:32:05 -08:00

15 lines
452 B
JavaScript

import Route from '@ember/routing/route';
import { collect } from '@ember/object/computed';
import { watchAll } from 'nomad-ui/utils/properties/watch';
import WithWatchers from 'nomad-ui/mixins/with-watchers';
export default Route.extend(WithWatchers, {
setupController(controller) {
controller.set('watcher', this.get('watch').perform());
return this._super(...arguments);
},
watch: watchAll('node'),
watchers: collect('watch'),
});