Skip to content
Advertisement

Tag: flatmap

Why many people say that flatmap in reactor is one-to-many?

I’ve read that wonderful answer about the difference between map and flatMap. And there is a picture that demonstrates flatmap: And quote: The map is for synchronous, non-blocking, one-to-one transformations while the flatMap is for asynchronous (non-blocking) One-to-Many transformations. Based on that picture and quote I understand that flatMap allows the creation of more (or fewer) elements than it was

Flatmap nested collection

I have a list of objects, some of them can be collections. I would like to get a stream of plain objects. I would like to get a stream with elements. I have tried I also checked an example which shows how to use a recursive function which flattens a collection. However, in this example .collect(Collectors.toList()); used to keep an

What is the difference between concatMap and flatMap in RxJava

It seems that these 2 functions are pretty similar. They have same signature (accepting rx.functions.Func1<? super T, ? extends Observable<? extends R>> func), and their marble diagrams look exactly same. Can’t paste the pics here, but here’s one for concatMap, and here’s one for flatMap. There seems to be some subtle difference in the description of resulting Observable, where one

Advertisement