0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 11:00:28 +01:00

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-collection
//= require discourse-common/addon/helpers/component-for-row //= require discourse-common/addon/helpers/component-for-row
//= require discourse-common/addon/lib/raw-templates //= require discourse-common/addon/lib/raw-templates
//= require discourse-common/lib/debounce
//= require discourse/app/helpers/discourse-tag //= require discourse/app/helpers/discourse-tag
//= require discourse/app/services/app-events //= require discourse/app/services/app-events

Datei anzeigen

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