Now all the data is fetched to do pagination, it could be done in an async way that as the backend comes up with more data it will push it to the client (ie. there are more pages) then the client when clicks on latter pages, it will fetch it using an offset from the cached data on the backend. This is a high-level description.