Skip to content

Commit f64cb3e

Browse files
committed
✨ feat:debounce 유틸 추가
Issue Resolved: #
1 parent 07dad69 commit f64cb3e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

front/src/utils/debounce.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const setDebounce = (delayTime: number) => {
2+
let timer: null | number = null;
3+
4+
return (callback: () => void) => {
5+
if (timer) {
6+
clearTimeout(timer);
7+
}
8+
9+
timer = setTimeout(callback, delayTime * 1000);
10+
};
11+
};
12+
13+
export const changeSeatCountDebounce = setDebounce(3);

0 commit comments

Comments
 (0)