Comment

Comment by vincentriemer

The correct way would be a mix of those two strategies: an onscroll handler that schedules an update through requestAnimationFrame (ensuring that it only gets scheduled once until the next frame update actually executes).

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton