Skip to content

Commit

Permalink
Proper runloop imports (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic authored Dec 9, 2021
1 parent 506d798 commit a765241
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions addon/-private/data-view/utils/scroll-handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { run } from '@ember/runloop';
import { begin, end } from '@ember/runloop';
import { scheduler } from 'ember-raf-scheduler';
import SUPPORTS_PASSIVE from './supports-passive';
const DEFAULT_ARRAY_SIZE = 10;
Expand Down Expand Up @@ -110,11 +110,11 @@ export class ScrollHandler {

// TODO add explicit test
if (topChanged || leftChanged) {
run.begin();
begin();
for (let j = 0; j < meta.handlers.length; j++) {
meta.handlers[j](event);
}
run.end();
end();
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/dummy/app/routes/examples/dbmon/route.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Route from '@ember/routing/route';
import { run } from '@ember/runloop';
import { later, next, cancel } from '@ember/runloop';
import getData from 'dummy/lib/get-data';

export default Route.extend({
Expand All @@ -11,12 +11,12 @@ export default Route.extend({
},

afterModel() {
run.later(this, this.loadSamples, 100);
later(this, this.loadSamples, 100);
},

loadSamples() {
this.controller.set('model', getData(this.numRows));
this._nextLoad = run.next(this, this.loadSamples);
this._nextLoad = next(this, this.loadSamples);
},

actions: {
Expand All @@ -30,7 +30,7 @@ export default Route.extend({
},

willTransition() {
run.cancel(this._nextLoad);
cancel(this._nextLoad);
this.controller.set('model', null);
}

Expand Down

0 comments on commit a765241

Please sign in to comment.