News for hackers. Stuff that matters.
Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by Spivak on Wednesday January 05, 2022 @11:57AM (#29811493)
If you’re doing that aren’t you kinda defeating the point of pagination? Paginated APIs to me are a contract that says the size of the results can be arbitrarily large and there be dragons if you try to fit them in memory.

With how many wrappers around paginated APIs to unpaginate them I must be wrong but it still bugs me.

Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by piaste on Wednesday January 05, 2022 @02:30PM (#29813717)
Sometimes the pagination is optional to allow the client to only get as many results as they can handle.

But far more often, the pagination is forced - get 100 results, hit this link for the next 100 - in order to limit the load on the server.

Most trivial scenario, client runs a search that's too generic, you don't want to waste server resources actually preparing 999999 results.