1
0
Fork 0

REFACTOR - remove _.debounce and _.isEqual

Lodash is being removed from core Discourse.
Dieser Commit ist enthalten in:
jbrw 2020-09-29 12:57:32 -04:00
Ursprung 662c7432ef
Commit 866926501f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: AF11336DC5C6EC71
2 geänderte Dateien mit 26 neuen und 24 gelöschten Zeilen

Datei anzeigen

@ -3,6 +3,7 @@ import { default as wizardSchema } from '../lib/wizard-schema';
import { set, get } from "@ember/object";
import Mixin from "@ember/object/mixin";
import { observes } from 'discourse-common/utils/decorators';
import { deepEqual } from 'discourse-common/lib/object';
export default Mixin.create({
didInsertElement() {
@ -90,7 +91,7 @@ export default Mixin.create({
toggleUndo() {
const current = this.get(this.componentType);
const original = this.originalObject;
this.set('showUndo', !_.isEqual(current, original));
this.set('showUndo', !deepEqual(current, original));
},
actions: {

Datei anzeigen

@ -1,5 +1,6 @@
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
import getUrl from 'discourse-common/lib/get-url';
import discourseDebounce from "discourse/lib/debounce";
var cache = {},
cacheTopicId,
@ -39,7 +40,7 @@ function performSearch(term, topicId, includeGroups, includeMentionableGroups, i
});
}
var debouncedSearch = _.debounce(performSearch, 300);
var debouncedSearch = discourseDebounce(performSearch, 300);
function organizeResults(r, options) {
if (r === CANCELLED_STATUS) { return r; }