Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c590212

Browse files
authored
docs: add comment about rootMargin
1 parent a242a3a commit c590212

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const observer = new IntersectionObserver(entries => {
1212
}
1313
}
1414
}, {
15+
// Currently the threshold is set to 256px from the bottom of the viewport
16+
// with a threshold of 0.1. This means the element will not load until about
17+
// 2 keyboard-down-arrow presses away from being visible in the viewport,
18+
// giving us some time to fetch it before the contents are made visible
1519
rootMargin: '0px 0px 256px 0px',
1620
threshold: 0.01
1721
})

0 commit comments

Comments
 (0)