# flatMap

inline fun < T , R > Flow<Flow< T >>. flatMap (crossinline mapper: suspend ( T ) -> R ): Flow< R >(source)

Transforms each inner Flow element using the given mapper function and flattens the result into a single Flow.

#### Return

A Flow of mapped and flattened elements

#### Parameters

mapper

A suspending function to transform each element

#### Type Parameters

T

The type of elements in the inner flows

R

The type of elements after applying the mapper

@ JvmName (name = "flatMapIterable")
inline fun < T , R > Flow< Iterable < T >>. flatMap (crossinline mapper: suspend ( T ) -> R ): Flow< R >(source)

Transforms each element from inner Iterables using the given mapper function and flattens the result into a single Flow.

#### Return

A Flow of mapped and flattened elements

#### Parameters

mapper

A suspending function to transform each element

#### Type Parameters

T

The type of elements in the iterables

R

The type of elements after applying the mapper