doInDefault and doInIO

This commit is contained in:
InsanusMokrassar committed 2021-05-10 19:24:21 +06:00
1 parent e9223d5502
commit df4eaea4b9
2 files changed
+9

No files matched your search

+1
View File
@@ -12,6 +12,7 @@
* **ALL DEPRECATIONS WERE REMOVED** * **ALL DEPRECATIONS WERE REMOVED**
* `Coroutines`: * `Coroutines`:
* New extension and function `doSynchronously` which are the same as `launchSynchronously` * New extension and function `doSynchronously` which are the same as `launchSynchronously`
* New extensions `doInDefault` and `doInIO`
## 0.4.36 ## 0.4.36
@@ -8,3 +8,11 @@ suspend inline fun <T> doInUI(noinline block: suspend CoroutineScope.() -> T) =
Dispatchers.Main, Dispatchers.Main,
block block
) )
suspend inline fun <T> doInDefault(noinline block: suspend CoroutineScope.() -> T) = withContext(
Dispatchers.Default,
block
)
suspend inline fun <T> doInIO(noinline block: suspend CoroutineScope.() -> T) = withContext(
Dispatchers.IO,
block
)