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() } }