REFACTOR: Use imports for Ember.run

This commit is contained in:
Robin Ward
2019-10-29 14:52:36 -04:00
parent c7475ee03b
commit 5ca60fcb6b
151 changed files with 485 additions and 270 deletions

View File

@@ -1,3 +1,4 @@
import { later } from "@ember/runloop";
let timeout;
const loadingQueue = [];
let localCache = {};
@@ -82,7 +83,7 @@ function loadNext(ajax) {
}
)
.finally(() => {
timeout = Ember.run.later(() => loadNext(ajax), timeoutMs);
timeout = later(() => loadNext(ajax), timeoutMs);
if (removeLoading) {
$elem.removeClass(LOADING_ONEBOX_CSS_CLASS);
$elem.data("onebox-loaded");
@@ -129,7 +130,7 @@ export function load({
if (synchronous) {
return loadNext(ajax);
} else {
timeout = timeout || Ember.run.later(() => loadNext(ajax), 150);
timeout = timeout || later(() => loadNext(ajax), 150);
}
}

View File

@@ -1,3 +1,4 @@
import { debounce } from "@ember/runloop";
let _cache = {};
export function lookupCachedUploadUrl(shortUrl) {
@@ -100,7 +101,7 @@ export function resolveAllShortUrls(ajax) {
$shortUploadUrls = $(attributes);
if ($shortUploadUrls.length > 0) {
// this is carefully batched so we can do a leading debounce (trigger right away)
return Ember.run.debounce(
return debounce(
null,
() => _loadShortUrls($shortUploadUrls, ajax),
450,