diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt index b3149217cb..bf4c4b8f74 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt @@ -13,13 +13,12 @@ fun aggregateFlows( internalBufferSize: Int = 64 ): Flow { val sharedFlow = MutableSharedFlow(extraBufferCapacity = internalBufferSize) - val bc = BroadcastChannel(internalBufferSize) flows.forEach { it.onEach { safely { sharedFlow.emit(it) } }.launchIn(withScope) } - return bc.asFlow() + return sharedFlow } fun Flow>.flatMap(): Flow = flow {