Fetch all pages of a cursor-paginated endpoint.
ESI returns cursor tokens in the response body. This helper follows after tokens until the dataset is exhausted (empty items array).
after
Usage with body-based cursors (ESI's actual format): const allJobs = await fetchAllCursorPages( (before, after) => client.freelanceJobs.getFreelanceJobs(before, after), (response) => response.freelance_jobs, (response) => response.cursor, );
Usage with CursorResult shape: const all = await fetchAllCursorPages( (before, after) => fetcher({ before, after }), (r) => r.data, (r) => r.cursors, );
Fetch all pages of a cursor-paginated endpoint.
ESI returns cursor tokens in the response body. This helper follows
aftertokens until the dataset is exhausted (empty items array).Usage with body-based cursors (ESI's actual format): const allJobs = await fetchAllCursorPages( (before, after) => client.freelanceJobs.getFreelanceJobs(before, after), (response) => response.freelance_jobs, (response) => response.cursor, );
Usage with CursorResult shape: const all = await fetchAllCursorPages( (before, after) => fetcher({ before, after }), (r) => r.data, (r) => r.cursors, );