async function fetchNine(manager) {
const result = []; // this will combine the results of each fetch call
let pivot = null;
while (result.length < 9) {
// fetch a pack
// if no pivot is available, pass undefined so the "before" parameter is ignored
const pack = await manager.fetch({limit: 3, before: pivot?.id});
// move the starting point to the current pack
pivot = pack.last();
// add the pack to the result
pack.forEach(entry => result.push(entry));
}
return result;
}
async function fetchNine(manager) {
const result = []; // this will combine the results of each fetch call
let pivot = null;
while (result.length < 9) {
// fetch a pack
// if no pivot is available, pass undefined so the "before" parameter is ignored
const pack = await manager.fetch({limit: 3, before: pivot?.id});
// move the starting point to the current pack
pivot = pack.last();
// add the pack to the result
pack.forEach(entry => result.push(entry));
}
return result;
}