Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 522 Bytes

manual_paging.md

File metadata and controls

20 lines (14 loc) · 522 Bytes

🠈 back to readme

product paging: using async generators

here's how to go page-by-page (perhaps refresh yourself on js iterators and generators)

const products = shopify.products()

const page1 = await products.next()
const [products, more] = page1.value!
console.log(products) //⮞ [{id: "a1", ...}, ...]
console.log(more) //⮞ false

if (more) {
  const page2 = await.products.next()
  //...
}