My use case is taking a long stream of functional-...
# announcements
g
My use case is taking a long stream of functional-like calls. Instead of wrapping everything around an
if
or assigning it all to a variable, I just call it like that:
Copy code
data
    .filter { it.hasErrors }
    .map { it.error }
    .any { it is MyException }
    .then { /*Treat that exception*/ }
a
there's
takeIf
,
?.
and
let