


Note that, since throw and return are expressions in Kotlin, they can also be used on the right-hand side. Please note that the right side expression will only be called if the left side expression is null. What I need is something that really stops the streaming when flowA is emitting null, unsubscribing from flowB until flowA produces another value (different from null). The Elvis operator will evaluate the left expression and will return it if it’s not null else will evaluate the right side expression. It just ignore null values, and the streaming continues, combining both flows, with the previous value being selected (whatever it was before the null value). The filterNotNull operator does not fit this use case, because it does not cancel the stream when a null value arrives. I do not have a solution and yours does not apply either. Sorry if this is not the right place (in this case, I suggest a review in the guidelines docs). What is Elvis Operator in Kotlin Elvis operator is performed on the nullable object to check whether a given value is null or not, if it is null then Elvis. This is why I asked here instead of in StackOverflow or similar - in a perspective that this scenario could be solved by a new operator or something like that, perhaps. The not null assertion () operator converts any value to a non-null type and throws an exception if the value is null. And, regarding feature requests, it states that "Explaining the problem you face is more important than suggesting a solution.". Sorry, checked the "Contributing Guidelines" and it states that "Both bug reports and feature requests are welcome".
