(
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
options: {
readonly concurrency: number | "unbounded"
readonly bufferSize?: number | undefined
}
)
| 2357 | * // FlatMap each number to create new channels |
| 2358 | * const flatMappedChannel = Channel.flatMap( |
| 2359 | * numberChannel, |
| 2360 | * (n) => |
| 2361 | * Channel.fromIterable(Array.from({ length: n }, (_, i) => `item-${n}-${i}`)) |
| 2362 | * ) |
| 2363 | * |
| 2364 | * Effect.runSync(Channel.runCollect(flatMappedChannel)) // => ["item-1-0", "item-2-0", "item-2-1", "item-3-0", "item-3-1", "item-3-2"] |
| 2365 | * ``` |
| 2366 | * |
| 2367 | * @category sequencing |
| 2368 | * @since 2.0.0 |
| 2369 | */ |
| 2370 | export const flatMap: { |
| 2371 | <OutElem, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>( |
| 2372 | f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, |
| 2373 | options?: { |
| 2374 | readonly concurrency?: number | "unbounded" | undefined |
| 2375 | readonly bufferSize?: number | undefined |
| 2376 | } |
| 2377 | ): <OutErr, OutDone, InElem, InErr, InDone, Env>( |
| 2378 | self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> |
| 2379 | ) => Channel< |
| 2380 | OutElem1, |
| 2381 | OutErr1 | OutErr, |
| 2382 | OutDone, |
| 2383 | InElem & InElem1, |
| 2384 | InErr & InErr1, |
| 2385 | InDone & InDone1, |
| 2386 | Env1 | Env |
| 2387 | > |
| 2388 | < |
| 2389 | OutElem, |
| 2390 | OutErr, |
| 2391 | OutDone, |
| 2392 | InElem, |
no test coverage detected
searching dependent graphs…