From 382b956bebe77326a27f6c542fd9382bec14b62c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 5 Apr 2021 16:20:11 +0600 Subject: [PATCH] make createWeakSubScope private, upfill readme --- CHANGELOG.md | 3 ++- .../kotlin/dev/inmo/micro_utils/coroutines/WeakJob.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ccdc09591a..74b429e3173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ * `Coroutines` * Add `WeakJob` workaround: - * `CoroutineScope#` + * `CoroutineScope#weakLaunch` + * `CoroutineScope#weakAsync` ## 0.4.32 diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/WeakJob.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/WeakJob.kt index a11dc6b99ed..c020a359ecb 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/WeakJob.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/WeakJob.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.* import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext -fun CoroutineScope.createWeakSubScope() = CoroutineScope(coroutineContext.minusKey(Job)).also { newScope -> +private fun CoroutineScope.createWeakSubScope() = CoroutineScope(coroutineContext.minusKey(Job)).also { newScope -> coroutineContext.job.invokeOnCompletion { newScope.cancel() } }