PagePromise
Esta página aún no está disponible en tu idioma.
What every list() returns: await it for one page ({ data, has_more, next_cursor }), or iterate it with for await to walk every item of every page.
Methods
Section titled “Methods”then / catch / finallyPromise<TPage>ObligatorioAwaiting gives the first page.
[Symbol.asyncIterator]()AsyncGenerator<TItem>Obligatoriofor await (const item of list): every item, following next_cursor.
pages()AsyncGenerator<TPage>ObligatorioEvery page, starting with the first.
autoPagingToArray(opts?)Promise<TItem[]>ObligatorioCollects items across pages, at most opts.limit (default 10,000).
autoPagingEach(fn)Promise<void>ObligatorioCalls fn for each item; return false to stop.
Example
Section titled “Example”const first = await tys.products.list({ limit: 20 });const all = await tys.products.list().autoPagingToArray({ limit: 500 });await tys.fitGroups.list().autoPagingEach((g) => { console.log(g.name); });page = tys.products.list(limit=20)next_page = page.next_page()for product in page.auto_paging_iter(): ...See also
Section titled “See also”¿Te ha resultado útil esta página?
Gracias. Leemos todas las respuestas.