`onEach` working for nullable iterables
See original GitHub issueCurrently, one cannot apply onEach validation if iterable field is nullable, for example val items: List<MyClass>?
There should be some way to do it either by making it possible to combine ifPresent
with onEach
or by making onEach
treat a null iterable in the same way as an empty iterable. There could also be new method like onEachIfPresent
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Dealing with parallel flux in Reactor - Stack Overflow
And on each iterable I have to make a rest call. ... It won't work immediately after flatMap because parallel() creates a ParallelFlux...
Read more >Iterable - Kotlin Programming Language
Returns the first non-null value produced by transform function being applied to elements of this collection in iteration order, or null if no...
Read more >IterableUtils (Apache Commons Collections 4.4 API)
Returns an immutable empty iterable if the argument is null, or the argument itself otherwise. static <E> Iterable<E>, emptyIterable(). Gets an empty iterable....
Read more >Iterable (Groovy JDK enhancements)
Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning...
Read more >Iterable class - dart:core library - Flutter - Dart API docs
Iterable <E> class Null safety. A collection of values, or "elements", that can be accessed sequentially. The elements of the iterable are accessed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 for nested option
I also like the nested option. It seems like a natural extension because onEach would work in the same way as it has been. I can try to implement it later.