Skip to content

README sample uses const instead of let when iterating paginated results #215

@doron2402

Description

@doron2402

Hi Square team 👋

In the Node.js SDK README, the pagination example uses:

const page = await client.bankAccounts.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

However, this snippet will throw an error because page is declared as a const but then reassigned inside the loop

let page = await client.bankAccounts.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions