mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 14:15:11 +08:00
DEV: Introduce discourseLater
(#17532)
A wrapper for `later()` from `@ember/runloop`, similar to `discourseDebounce`. It automatically reduces the delay in testing environment.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import Component from "@ember/component";
|
||||
import { afterRender } from "discourse-common/utils/decorators";
|
||||
import { later } from "@ember/runloop";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "section",
|
||||
@ -20,7 +20,7 @@ export default Component.extend({
|
||||
this.set("iconIds", ids.sort());
|
||||
} else {
|
||||
// Let's try again a short time later if there are no svgs loaded yet
|
||||
later(this, this.setIconIds, 1500);
|
||||
discourseLater(this, this.setIconIds, 1500);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user