Hello David,
Why not returning if the query has next or not from the backend? For this will allow you to check if there are more results left to be rerieved.
export function getData(skip) {
let query = wixData.query('collection').eq('property', value);
if (skip) { query = query.skip(skip) }
return query.find().then((x) => {
return {
items: x.items;
hasNext: x.hasNext();
}
})
}
This will make the hasNext property returned from the backend a boolean so you can read it immediatelty without calling a function.
Hope this helps!~
Ahmad