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

Fixed order method #24

Merged
merged 4 commits into from
Aug 23, 2024
Merged

Fixed order method #24

merged 4 commits into from
Aug 23, 2024

Conversation

Emily-ejag
Copy link
Contributor

@Emily-ejag Emily-ejag commented Aug 22, 2024

This method removes and returns the first item in the array, making sure the items are presented in a fixed order.

@Emily-ejag Emily-ejag self-assigned this Aug 22, 2024
@Emily-ejag Emily-ejag added the enhancement New feature or request label Aug 22, 2024
@coveralls
Copy link

coveralls commented Aug 22, 2024

Pull Request Test Coverage Report for Build 10530448346

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 97.586%

Totals Coverage Status
Change from base Build 6551061545: -0.09%
Covered Lines: 408
Relevant Lines: 412

💛 - Coveralls

src/index.ts Outdated
Comment on lines 307 to 308
throw new Error('No items left in the array to select.');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the behavior we want? Should we throw an error when the user has exhausted all of the available items? We don't do this in any of the other selector methods. I think if we want to do this, we should do it for all of the methods.

Tagging @AnyaWMa and @Emily-ejag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added that because it gave me an no-null assertion error.

Do you think changing the next item for this is fine? const nextItem = arr.shift() ?? null;

@richford richford merged commit a8dd604 into main Aug 23, 2024
6 checks passed
@richford richford deleted the enh/fixed-order-method branch August 23, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants