-
Notifications
You must be signed in to change notification settings - Fork 275
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 takeWhileInclusive operator #383
Conversation
Codecov Report
@@ Coverage Diff @@
## master #383 +/- ##
==========================================
+ Coverage 93.35% 93.44% +0.09%
==========================================
Files 59 60 +1
Lines 2016 2044 +28
==========================================
+ Hits 1882 1910 +28
Misses 134 134 |
I was just going to open a PR for exactly this, but you beat me to it hehe :) I'll check it asap, many thanks! |
} catch (e, s) { | ||
controller.addError(e, s); | ||
// The test didn't say true. Didn't say false either, but we stop anyway. | ||
controller.close(); |
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.
This line should be removed:
upon listening, one can choose to set cancelOnError: false
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.
This behavior is same as Stream.takeWhile
, https://dartpad.dartlang.org/8949740dda7ba576ed0241089a5041da
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.
Heh you're right :)
In that case it's best to do the same thing indeed!
|
||
/// Emits values emitted by the source Stream so long as each value | ||
/// satisfies the given test. When the test is not satisfied by a value, will | ||
/// emit it and complete. |
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.
Just wording here: I'd use "... it will emit this value as a final event and then complete "
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.
Fixed :))
extension TakeWhileInclusiveExtension<T> on Stream<T> { | ||
/// Emits values emitted by the source Stream so long as each value | ||
/// satisfies the given test. When the test is not satisfied by a value, will | ||
/// emit it and complete. |
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.
same as above
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.
Fixed :))
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.
Thanks for helping out!
Thanks so much, @hoc081098, and sorry about the delay! I'll merge this in :) |
#370