make createWeakSubScope private, upfill readme

This commit is contained in:
InsanusMokrassar committed 2021-04-05 16:20:11 +06:00
1 parent 36deab4909
commit 382b956beb
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -4,7 +4,8 @@
* `Coroutines`
* Add `WeakJob` workaround:
* `CoroutineScope#`
* `CoroutineScope#weakLaunch`
* `CoroutineScope#weakAsync`
## 0.4.32
@@ -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() }
}