We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a76b6d4 commit aa385b6Copy full SHA for aa385b6
src/pages/posts/hooks/useObserver.ts
@@ -1,7 +1,7 @@
1
import { useCallback, useRef } from 'react';
2
3
const useObserver = (callback: () => void) => {
4
- const observerOption = useRef({ threshold: 1 });
+ const observerOption = useRef({ threshold: 0.5 });
5
const observerFn: IntersectionObserverCallback = useCallback(
6
(entries, observer) => {
7
entries.forEach((entry) => {
@@ -10,6 +10,7 @@ const useObserver = (callback: () => void) => {
10
}
11
if (entry.isIntersecting) {
12
callback();
13
+ console.log('intersectioning');
14
15
});
16
},
0 commit comments