Skip to content
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

fix: optimize pageSize when a limit less than pageSize is given #236

Merged
merged 2 commits into from
Apr 15, 2022

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR optimizes pageSize when a limit is given that is less than pageSize.

Before this PR, pageSize would always be the given value or the default (100). This means more documents may be fetched than needed to satisfy the limit param.

Closes: #232

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

@github-actions
Copy link

size-limit report 📦

Path Size
dist/index.js 4.02 KB (+0.2% 🔺)
dist/index.cjs 6.88 KB (+0.13% 🔺)

@angeloashmore angeloashmore merged commit 3bec394 into master Apr 15, 2022
@angeloashmore angeloashmore deleted the aa/optimize-getall-small-limits branch April 19, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize getAll* methods for small limits
1 participant