Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1x 1x 6x 6x 11x 11x 6x 11x 6x 6x 1x 5x 5x 1x 3x 3x 1x | export class _common {
static debounce(func, timeout = 300) {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, timeout);
};
}
static genEvent(node, name, data, propagateToParents = true) {
node.dispatchEvent(new CustomEvent(name, { detail: data, bubbles: propagateToParents }));
}
static getTag(node) {
return node.tagName?.toLowerCase();
}
}
|