You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not get this async iterator block (from the README.md) to work locally:
Theasynchronousiteratorcanbeuseddirectlyviathefor-await-ofsyntax:
forawait(constaccountofclient.accounts.list()){account//= Account// do something with account// after some condition is met, stop iteratingif(someConditionMet)break}
client.accounts.list() returns a Promise<ResourceList<Account>> which is not iterable due to the wrapper promise. Adding an await in front of client.accounts.list unwrapped it and made it work.
forawait(constaccountofawaitclient.accounts.list()){account//= Account// do something with account// after some condition is met, stop iteratingif(someConditionMet)break}
The text was updated successfully, but these errors were encountered:
Hi,
I could not get this async iterator block (from the README.md) to work locally:
client.accounts.list()
returns aPromise<ResourceList<Account>>
which is not iterable due to the wrapper promise. Adding an await in front ofclient.accounts.list
unwrapped it and made it work.The text was updated successfully, but these errors were encountered: