sirdashasan / ecommerce

https://ecommerce-one-sable-80.vercel.app
0 stars 0 forks source link

T15: Products Pagination | infinite scrolling #14

Open sirdashasan opened 4 months ago

sirdashasan commented 4 months ago

Sample Case:

if you fetch first 25 products on page 1, and then you want to fetch products from 25 to 50 for page 2 you need to set offset 25 and url should be products?limit=25&offset=25 and then you want to fetch products from 50 to 75 for page 3, the url => products?limit=25&offset=50

Sample react pagination and infinite scroll components, you can use different libraries!

- [React Infinite Scroll Component](https://www.npmjs.com/package/react-infinite-scroll-component)

- [React Pagination](https://www.npmjs.com/package/react-paginate)
erhanfirat commented 4 months ago

fazladan bir request gönderiliyor. o kaldırılmalı