Skip to content

Commit

Permalink
[Optimize] inspector throtle 0513 (cocos#11093)
Browse files Browse the repository at this point in the history
* feat: add debounce

* feat: add debounce
  • Loading branch information
dogodo-cc authored Jun 9, 2022
1 parent 0443ec3 commit cc65a5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/inspector/contributions/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
const fs = require('fs');
const path = require('path');
const utils = require('./utils');
module.paths.push(path.join(Editor.App.path, 'node_modules'));
const { debounce } = require('throttle-debounce');

exports.listeners = {
async 'change-dump'(event) {
'change-dump': debounce(500, async (event) => {
const panel = this;

const target = event.target;
if (!target) {
return;
Expand Down Expand Up @@ -92,7 +93,7 @@ exports.listeners = {
} catch (error) {
console.error(error);
}
},
}),
'confirm-dump'() {
const panel = this;

Expand Down

0 comments on commit cc65a5a

Please sign in to comment.