I have function that return Mono<Boolean>
and I want to map it to Mono<Void>
(since this is something I return in my Controller method).
Is there any better way to return such Mono
instead of .flatMap { Mono.empty<Void>() }
?
I can't use .map{ null }
because mapping function cannot accept null
s.
yes, simply use booleanMono.then()
. it only propagates the terminal signals (onComplete
or onError
) as a Mono<Void>
, ditching the onNext
event.