Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 7, 2024
1 parent b2105f8 commit 7b2a4f7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions source/advanced-editors-messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ export default function unsafeMessenger() {

function throttle(interval, callback) {
let timer;
return (...args) => {
if (!timer) {
timer = setTimeout(() => {
timer = false;
callback(...args);
}, interval);
}
return (...arguments_) => {
timer ||= setTimeout(() => {
timer = false;
callback(...arguments_);
}, interval);
};
}

Expand Down

0 comments on commit 7b2a4f7

Please sign in to comment.