Skip to content

Commit

Permalink
Fix PaginatedResult.next() usage
Browse files Browse the repository at this point in the history
PaginatedResult.next() type was updated in ably-js v2 [1] to return null
in case of no page.

[1] ably/ably-js@8bd1706
  • Loading branch information
VeskeR committed Jul 17, 2024
1 parent 8d11078 commit 759603e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CursorHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default class CursorHistory {
pageNo++;

while (pageNo <= paginationLimit && this.positionsMissing(connections) && history.hasNext()) {
page = await history.next();
// assert result of .next() is non null as we've checked .hasNext() before
page = (await history.next())!;
connections = this.allCursorUpdates(connections, page);
pageNo++;
}
Expand Down

0 comments on commit 759603e

Please sign in to comment.