DEV Community

Discussion on: Making interacting with the Airtable API even easier

Collapse
 
makingthings profile image
James Grubb

Hi thank you for creating AsyncAirtable. Before I try it I am hoping to get my head round Airtable.js. In your code eaxample above

let results = [];
base('TEST').select({})
  .eachPage(function page(records, fetchNextPage) {
    records.forEach(function(record) {
        results.push(record);
    });
    fetchNextPage();
  }, function done(err) {
    if (err) { console.error(err); return; }
    done();
});
Enter fullscreen mode Exit fullscreen mode

if I console.log(results) i get []
Do i need to create a promise?
Thanks in advance