-
Notifications
You must be signed in to change notification settings - Fork 206
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
until/takeUntil with predicate function #427
Comments
Hi @OliverJAsh. I see, yes, there's a subtle difference around the end. Do you have a concrete use case for it? If you can share it, that might help us think about how broadly useful this kind of operation is, and whether it belongs in the core or another package. Thanks! |
Hi @briancavalier! My use case is paginating an API response of ordered items until an item exceeds the range, for example: https://gist.github.com/OliverJAsh/2c327ae63941a237594eed34fe60a47b#file-foo-js-L97 I have an async generator that iterates the pages of Twitter’s |
Thanks for the additional info @OliverJAsh. I see what you mean about inclusive vs. exclusive. At first glance, it seems possible to use We're trying to be more strict with types, and avoid runtime type checks, so I'd rather not overload the name Random thoughts about names: |
I had a look at There is a similar discussion on the subject of naming in this thread on RxJava: ReactiveX/RxJava#1649 |
I kinda like the name Trying to think of a name using "take" that describes this operation, without using the word "until" is tricky! I think Other ideas? |
|
I also favor |
Cool, thanks @davidchase and @Frikki. Let's go with |
Hey @OliverJAsh, we just released 1.3.0 with skipAfter. Check it out, and let us know if it works for you. |
Thanks @briancavalier, I'll let you know! |
Hi @OliverJAsh. Closing, but please reopen if there's something more we need to discuss or do. |
The
until
/takeUntil
function accepts an input stream, however I was wondering if we could add support for a predicate function? This is different fromtakeWhile
because it is inclusive of the first item to returnfalse
.For inspiration, have a look at the API for RxJava which has similar options (stream or predicate) for its
takeUntil
operator: http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeUntil(rx.functions.Func1)The text was updated successfully, but these errors were encountered: