1
0
Fork 0

Use ember debounce until discourseDebounce hits stable

Dieser Commit ist enthalten in:
Angus McLeod 2021-01-04 14:22:43 +08:00
Ursprung 11ff364cbe
Commit 78dad97dc8
2 geänderte Dateien mit 3 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -84,7 +84,6 @@
//= require discourse-common/addon/helpers/component-for-collection
//= require discourse-common/addon/helpers/component-for-row
//= require discourse-common/addon/lib/raw-templates
//= require discourse-common/lib/debounce
//= require discourse/app/helpers/discourse-tag
//= require discourse/app/services/app-events

Datei anzeigen

@ -1,6 +1,5 @@
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
import { debounce } from "@ember/runloop";
import discourseDebounce from "discourse-common/lib/debounce";
import getUrl from 'discourse-common/lib/get-url';
var cache = {},
@ -118,10 +117,8 @@ export default function userSearch(options) {
resolve(CANCELLED_STATUS);
}, 5000);
// TODO: Use discouseDebounce after the 2.7 release.
let debounceFunc = discourseDebounce || debounce;
debounceFunc(
// TODO: Use discouseDebounce after it is available on stable.
debounce(
this,
function() {
performSearch(
@ -140,4 +137,5 @@ export default function userSearch(options) {
},
300
)
});
}