Skip to content

Commit 1b08db7

Browse files
authored
adding missing await (microsoftgraph#526)
1 parent 22233e9 commit 1b08db7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/tasks/PageIterator.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function callingPattern() {
1717
// Creating a new page iterator instance with client a graph client instance, page collection response from request and callback
1818
let pageIterator = new PageIterator(client, response, callback);
1919
// This iterates the collection until the nextLink is drained out.
20-
pageIterator.iterate();
20+
await pageIterator.iterate();
2121
} catch (e) {
2222
throw e;
2323
}
@@ -44,12 +44,12 @@ async function customSize() {
4444
};
4545
let pageIterator = new PageIterator(client, response, callback);
4646
// This stops iterating over for 1000 entities.
47-
pageIterator.iterate();
47+
await pageIterator.iterate();
4848

4949
// Resuming will do start from where it left off and iterate for next 1000 entities.
5050
// Check and resume is likely to be called in any user interaction requiring to load more data.
5151
if (!pageIterator.isComplete()) {
52-
pageIterator.resume();
52+
await pageIterator.resume();
5353
}
5454
} catch (e) {
5555
throw e;

0 commit comments

Comments
 (0)