2282f3243a
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
17 lines
407 B
JavaScript
17 lines
407 B
JavaScript
import Mixin from '@ember/object/mixin';
|
|
import { computed } from '@ember/object';
|
|
import { assert } from '@ember/debug';
|
|
|
|
export default Mixin.create({
|
|
watchers: computed(() => []),
|
|
|
|
actions: {
|
|
willTransition() {
|
|
this.get('watchers').forEach(watcher => {
|
|
assert('Watchers must be Ember Concurrency Tasks.', !!watcher.cancelAll);
|
|
watcher.cancelAll();
|
|
});
|
|
},
|
|
},
|
|
});
|