FIX: Use Ember's debounce on stable. (#147)
We need to wrap the new debounce function inside a try block to avoid throwing a "module not found" exception.
This commit is contained in:
parent
b1b8c94f56
commit
394f857096
|
@ -1,6 +1,10 @@
|
|||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { debounce } from "@ember/runloop";
|
||||
|
||||
// TODO: Remove this file and use discouseDebounce after the 2.7 release.
|
||||
const debounceFunction = discourseDebounce || debounce;
|
||||
let debounceFunction = debounce;
|
||||
|
||||
try {
|
||||
debounceFunction = require("discourse-common/lib/debounce").default;
|
||||
} catch (_) {}
|
||||
|
||||
export default debounceFunction;
|
||||
|
|
Loading…
Reference in New Issue