Add main menu; add panel fixes

This commit is contained in:
obergodmar
2020-07-01 21:35:19 +03:00
parent 4b1666c584
commit 839355f1de
15 changed files with 194 additions and 78 deletions
+4 -7
View File
@@ -20,15 +20,12 @@ export const randomNumber = (min: number, max: number) => (
Math.floor(Math.random() * (max - min)) + min
)
export const debounce = (fn: () => any, ms: number) => {
let timer: NodeJS.Timeout | null
return () => {
export function debounce(fn: (args: any) => any, ms: number) {
let timer: NodeJS.Timeout
return (...args: any) => {
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
timer = null
fn()
}, ms)
timer = setTimeout(() => fn.apply(this, args), ms)
}
}