seamless-streaming-v0 / streaming-react-app /src /isScrolledToDocumentBottom.ts
Anna Sun
squash for release
2485dd8
raw
history blame
226 Bytes
export default function isScrolledToDocumentBottom(
bufferPx: number = 0,
): boolean {
if (
window.innerHeight + window.scrollY >=
document.body.offsetHeight - bufferPx
) {
return true;
}
return false;
}