refactor(editor): Apply Prettier (no-changelog) (#4920)
* ⚡ Adjust `format` script * 🔥 Remove exemption for `editor-ui` * 🎨 Prettify * 👕 Fix lint
This commit is contained in:
@@ -2,20 +2,25 @@ import { debounce } from 'lodash';
|
||||
import Vue from 'vue';
|
||||
|
||||
export const debounceHelper = Vue.extend({
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
debouncedFunctions: [] as any[], // tslint:disable-line:no-any
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async callDebounced (...inputParameters: any[]): Promise<void> { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
async callDebounced(...inputParameters: any[]): Promise<void> {
|
||||
const functionName = inputParameters.shift() as string;
|
||||
const { trailing, debounceTime } = inputParameters.shift();
|
||||
const { trailing, debounceTime } = inputParameters.shift();
|
||||
|
||||
// @ts-ignore
|
||||
if (this.debouncedFunctions[functionName] === undefined) {
|
||||
// @ts-ignore
|
||||
this.debouncedFunctions[functionName] = debounce(this[functionName], debounceTime, trailing ? { trailing } : { leading: true } );
|
||||
this.debouncedFunctions[functionName] = debounce(
|
||||
this[functionName],
|
||||
debounceTime,
|
||||
trailing ? { trailing } : { leading: true },
|
||||
);
|
||||
}
|
||||
// @ts-ignore
|
||||
await this.debouncedFunctions[functionName].apply(this, inputParameters);
|
||||
|
||||
Reference in New Issue
Block a user