I have some question regarding pagination
Hello we are doing a fullstack project and we have a fetch query
Now the data I get from the backend is this
{
data: []
totalPages: number,
all: number (all documents)
}
So how would I fetch and map how to get the total pages to limit it
4 Replies
rival-black•16mo ago
So how would I fetch and map how to get the total pages to limit itI don't understand that question. can you rephrase please?
stormy-goldOP•16mo ago
My main question is how can I set max pages when I dont know how many are there to begin I get it from the request to the backend
absent-sapphire•16mo ago
If the
current data is less than limit, then you are on the last page.rival-black•16mo ago
If you're talking about the
maxPages option, that is something that you can set to limit how much is stored in the cache. For this setting, it doesn't matter how many pages there actually are. If you want to always store everything, you don't need to set maxPages