Skip to content

Instantly share code, notes, and snippets.

View fmanimashaun's full-sized avatar
🎯
Cogito, ergo sum | nanos gigantum humeris insidentes

Animashaun Fisayo Michael fmanimashaun

🎯
Cogito, ergo sum | nanos gigantum humeris insidentes
View GitHub Profile
@fmanimashaun
fmanimashaun / debounce.ts
Created July 14, 2024 10:17
Custom Debounce Function in TypeScript
// debounce.ts
const debounce = (callback: Function, delay: number): Function => {
let intervalId: number | NodeJS.Timeout;
return (...args: any) => {
if (intervalId) {
clearTimeout(intervalId);
}
intervalId = setTimeout(() => {