MattGibney / DarkThrone

Lovingly re-creating the DarkThrone experience.
https://darkthronereborn.com
1 stars 0 forks source link

Attack List Pagination #35

Closed MattGibney closed 4 months ago

MattGibney commented 4 months ago

This change adds pagination to the attack list. The big point of note here is the pagination logic in both the API and on the React app are re-usable. Additional resources that need to be paginated in the future can make use of this same approach with minimal effort. 🙌🏻

Also note that I kept the methods for fetching ALL players. This is useful for the scripts that process attack turns etc. They can be updated later to support pagination, I just wanted to avoid this PR getting too large :)


Demo

https://github.com/MattGibney/DarkThrone/assets/48440667/b2414857-8b62-483a-ac8f-0f7ef0f17674

This demo has page size set to 2. It's actually specified as 100 in code.

MattGibney commented 4 months ago

All updates made based on suggestions / discussion.