-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The great summer package update (#20)
- Loading branch information
1 parent
89393d6
commit b8349f2
Showing
9 changed files
with
1,132 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v16.19.0 | ||
v20.15.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,2 @@ | ||
/** | ||
* Debounces a function by limiting the rate at which it is called. | ||
* The debounced function will be called immediately when first called, | ||
* and then at most once every `wait` milliseconds during subsequent calls. | ||
* If `trailing` is set to `true`, the function will also be called once | ||
* after the last event is triggered. | ||
* | ||
* @param {() => void} func - The function to be debounced. | ||
* @param {number} wait - The number of milliseconds to wait before allowing the function to be called again. | ||
* @param {boolean} trailing - Whether to call the function once after the last event is triggered. | ||
* @returns {() => void} - The debounced function. | ||
*/ | ||
export const debounce = (func: () => void, wait: number, trailing: boolean): () => void => { | ||
let timeout: NodeJS.Timeout | null = null; | ||
|
||
return () => { | ||
const later = () => { | ||
timeout = null; | ||
if (trailing) { | ||
func(); | ||
} | ||
}; | ||
|
||
if (timeout === null) { | ||
func(); | ||
} else { | ||
clearTimeout(timeout); | ||
} | ||
timeout = setTimeout(later, wait); | ||
}; | ||
} | ||
|
||
export const isWindows = | ||
["Windows", "Win16", "Win32", "WinCE"].includes(navigator.platform); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.