Skip to content

Commit

Permalink
Type improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
crummy committed Jan 23, 2025
1 parent 7a06a9b commit 4bcc006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/svg+xml" href="/ppegjs-demo/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>pPEGjs Demo</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const initialExample = examples.find(e => e.highlighted)?.title
resize(output)
}

const debounce = function (fn: Function, delay: number = 300) {
const debounce = <T extends (...args: unknown[]) => void>(fn: T, delay: number = 300) => {
let timeoutId: ReturnType<typeof setTimeout>;

return function (this: any, ...args: any[]) {
return function(this: ThisParameterType<T>, ...args: Parameters<T>) {
if (timeoutId) {
clearTimeout(timeoutId);
}
Expand Down

0 comments on commit 4bcc006

Please sign in to comment.