Improve mobile app initialization and range widget corner indicator
This commit is contained in:
@@ -108,3 +108,13 @@ export function getNodeInfo(nodeId: number): string {
|
||||
const title = app.lGraph.getNodeById(nodeId)?.title || String(nodeId);
|
||||
return title + " (" + nodeId + ")"
|
||||
}
|
||||
|
||||
export const debounce = (callback: Function, wait = 250) => {
|
||||
let timeout: NodeJS.Timeout | null = null;
|
||||
return (...args: Array<unknown>) => {
|
||||
const next = () => callback(...args);
|
||||
if (timeout) clearTimeout(timeout);
|
||||
|
||||
timeout = setTimeout(next, wait);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user