mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-20 07:13:50 +00:00
make createWeakSubScope private, upfill readme
This commit is contained in:
parent
36deab4909
commit
382b956beb
@ -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() }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user