From d4b4547718849be998614054bf4a6840bb5163a1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 12 Nov 2020 22:16:21 +0600 Subject: [PATCH] plus for flows --- CHANGELOG.md | 3 +++ .../kotlin/dev/inmo/micro_utils/coroutines/FlowsSum.kt | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowsSum.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 821aa8e4d02..a2db76ddf4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.3.3 +* `Coroutines`: + * New extension `Flow#plus` + ## 0.3.2 * `Versions`: diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowsSum.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowsSum.kt new file mode 100644 index 00000000000..3c3fe0f87e0 --- /dev/null +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowsSum.kt @@ -0,0 +1,8 @@ +@file:Suppress("NOTHING_TO_INLINE") + +package dev.inmo.micro_utils.coroutines + +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.merge + +inline operator fun Flow.plus(other: Flow) = merge(this, other)