The task was to build an offline capable site which displayed the latest Hacker News posts, and loaded more lazily when scrolling.
I had to use the official HN API, and I couldn't have any middleware or caching. Everything had to be done client-side.
The app ended up being 1.4kb in total, with support for practically streaming in the items, batching them by network response times and render frames, while keeping the order.
You can see it in action here: https://hn-scroll.netlify.com/
The task was to build an offline capable site which displayed the latest Hacker News posts, and loaded more lazily when scrolling. I had to use the official HN API, and I couldn't have any middleware or caching. Everything had to be done client-side.
The app ended up being 1.4kb in total, with support for practically streaming in the items, batching them by network response times and render frames, while keeping the order.
You can see the batched items in this version: https://codesandbox.io/s/hardcore-stonebraker-8m8fx