DEV Community

loading...
Cover image for Vanilla JavaScript Infinite Scroll using WordPress REST API

Vanilla JavaScript Infinite Scroll using WordPress REST API

castroalves profile image Cadu de Castro Alves ・1 min read

This pen is a real example of how to build an Infinite Scroll in Vanilla JavaScript. I've used Fetch API, Intersection Observer API, and WordPress REST API to fetch posts. Feel free to fork, use, and modify this code.

Discussion

pic
Editor guide