make createWeakSubScope private, upfill readme

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

View File

@ -4,7 +4,8 @@
* `Coroutines`
* Add `WeakJob` workaround:
* `CoroutineScope#`
* `CoroutineScope#weakLaunch`
* `CoroutineScope#weakAsync`
## 0.4.32

View File

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