-
Notifications
You must be signed in to change notification settings - Fork 13
Feature/#25 pagination #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
8719e4f
#25 add query builder
easingthemes 5dc358f
#25 add paginated query suport
easingthemes a8f77ed
#25 lint fixes
easingthemes 00d4b23
#25 add default empty args
easingthemes da823af
#25 add jsdocs
easingthemes cfb682b
#25 check required params
easingthemes 90dc9c4
#25 throw if required param missing
easingthemes 9c22f02
#25 split large method
easingthemes 3ea8e06
#25 fix object to args string
easingthemes 20332d1
#25 move args update in the loop
easingthemes 335ed17
#25 update offset
easingthemes aa5f2dc
#25 update pagingArgs
easingthemes 00551b4
#25 check page size
easingthemes 767b18a
#25 fix string as a param val
easingthemes ee52188
#25 fix string as a param val
easingthemes 85f27db
#25 check page size
easingthemes 06efd4e
#25 ok response with errors data
easingthemes 8e5ce4a
#25 update docs
easingthemes 71e3c49
#25 remove loop break
easingthemes f641ee1
#25 add possibility to loop all
easingthemes 456c1f1
#25 update docs
easingthemes 8352f49
#25 add unit tests
easingthemes da821e8
#25 add jsdocs and more examples
easingthemes f4a2d91
#25 rename and reorder methods
easingthemes 83f28a2
#25 update docs
easingthemes e846b0a
#25 move static methods to utils
easingthemes 79b0bea
#25 jsdocs update
easingthemes c414f3c
#25 add typeDefs to readme
easingthemes 11899f9
#25 fix helper functions
easingthemes 8beda7d
#25 typo fix
easingthemes 7e157a2
#25 prevent empty request
easingthemes 3d200b9
#25 simplify readme examples
easingthemes 681b08d
feat: #25 add pageSize config
easingthemes eaf900e
fix: #25 update docs
easingthemes 19e19c5
fix: #25 reorder arguments
easingthemes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding: This pattern uses the same approach under the hood than the one using
done
/next()
.Or, in other words: this pattern does not load everything before entering the loop, it uses lazy loading whenever there are not enough items (aka the next page) is read.
Otherwise it would be counterproductive to what we're trying to achieve with paging.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uses exactly the same code/approach as done/next,
const cursorQueryAll = await aemHeadlessClient.runPaginatedQuery
is not making any requests.
Requests are in
for loop
for each page.