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

Add an Optional Offset to Capped Projections #3

Closed
mcordingley opened this issue Aug 31, 2013 · 2 comments
Closed

Add an Optional Offset to Capped Projections #3

mcordingley opened this issue Aug 31, 2013 · 2 comments

Comments

@mcordingley
Copy link

It would be helpful if the capped projection could also take an additional option specifying how far to offset before returning items. This option would of course default to zero if not provided.

As an example, setting "cap" to 5 and not setting "skip" would have a projection that shows indices 0 - 4, inclusive. Setting "cap" to 5 and "skip" to 2 would show indices 2 - 6, inclusive.

It could be "skip", "offset", or whatever makes the most sense.

Thanks again.

@andreypopp
Copy link
Owner

Can we do it on top of FilteredCollection? Like providing a filter to skip items with index less than a desired value?

Then you can just combine such a filtered projection with CappedCollection.

@mcordingley
Copy link
Author

Yeah, I think that would do it. The other way would be more convenient, but this keeps the core concepts purer, which is good.

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

No branches or pull requests

2 participants