Skip to content

Commit 2155129

Browse files
Ishan VeerIshan Veer
authored andcommitted
removed debounce function as it is already defined globally
1 parent b3c7664 commit 2155129

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

users/discord/components/UsersSection.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,10 @@ export const UsersSection = ({
99
currentPage,
1010
isLoading,
1111
}) => {
12-
const debounce = (func, delay) => {
13-
let timeoutId;
14-
return function (...args) {
15-
clearTimeout(timeoutId);
16-
timeoutId = setTimeout(() => {
17-
func.apply(this, args);
18-
}, delay);
19-
};
20-
};
21-
2212
window.addEventListener(
2313
'scroll',
2414
debounce(() => {
15+
console.log('scroll triggered');
2516
if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
2617
fetchUsers(activeTab, currentPage + 1);
2718
}

0 commit comments

Comments
 (0)