fun Mono<Something>.update(): Mono<Something2> {
return flatMap { mySomething ->
// some stuff
}.map()
}
How does the above code works?
- What does
Mono<Something>
means before the name of the function/method? - How can it use
flatMap
without any object in front? I thoughtflatmap
usage is likeSomeArray.flatMap{}
- what does
mySomething
refer to in this case? - What's the purpose of doing
flatMap
then chain it withmap
?