const scrollTop = container.scrollTop; const contentHeight = container.scrollHeight; const height = container.clientHeight; const shouldTrigger = contentHeight - height - scrollTop