- Preparing search index...
- The search index is not available
itr8
- flatMap<TIn, TOut>(mapFn: ((nextIn: TIn) => Iterable<TOut> | AsyncIterable<TOut>)): TTransIteratorSyncOrAsync<TIn, TOut>
-
Type Parameters
-
TIn = unknown
-
TOut = unknown
Parameters
-
mapFn: ((nextIn: TIn) => Iterable<TOut> | AsyncIterable<TOut>)
-
- (nextIn: TIn): Iterable<TOut> | AsyncIterable<TOut>
-
Returns Iterable<TOut> | AsyncIterable<TOut>
flatMap is a essentially a combination of the map operator followed by flatten. The mapping function can be any function that produces an iterable:
All elemants will be handled, and there is no state held between the values of the input operator.
Example
Returns