-
Notifications
You must be signed in to change notification settings - Fork 273
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
Deprecate whereNotNull() and add nonNulls to follow Dart's naming conventions on the Iterable #781
Comments
I think we should keep
Stream.fromIterable([1, 2, 3, null, 4])
.whereNotNull()
.where((i) => i.isEven)
.switchMap(...)
.listen(...) compared to Stream.fromIterable([1, 2, 3, null, 4])
.nonNulls
.where((i) => i.isEven)
.switchMap(...)
.listen(...)
What do you think? |
I totally get what you are saying. I wouldn't have named Dart's non-null filter However, working with Now, when working with streams and iterables, I always need to keep in mind which one I'm using, and I need to remember that streams and iterables have different methods/getters to filter out Giving this issue the title Replace whereNotNull() with nonNulls was incorrect on my part, in my opinion,
This will keep old code working and also allow users update when they can with a very small update (it's basically find all and replace). I updated the title to capture better what my suggestion is: Deprecate whereNotNull() and add nonNulls to follow Dart's naming conventions on the Iterable. Another approach could be to have both, and let users pick which they like more, though I'm not sure that's a great idea. |
Dart has a
nonNulls
static extension method on theIterable
.The
collection
package also deprecatedwhereNotNull
and asks users to usenonNulls
.It would be great if the same name could be used on
Stream
s withrxdart
.The text was updated successfully, but these errors were encountered: