-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
Pull Request Test Coverage Report for Build 10530448346Details
💛 - Coveralls |
src/index.ts
Outdated
throw new Error('No items left in the array to select.'); | ||
} |
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.
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
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.
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;
This method removes and returns the first item in the array, making sure the items are presented in a fixed order.