diff --git a/CHANGELOG.md b/CHANGELOG.md index 2883d69f3f2..1b826566561 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ * `Klock`: `2.0.7` -> `2.1.0` * `UUID`: `0.2.4` -> `0.3.0` * **ALL DEPRECATIONS WERE REMOVED** +* `Coroutines`: + * New extension and function `doSynchronously` which are the same as `launchSynchronously` ## 0.4.36 diff --git a/coroutines/src/jvmMain/kotlin/dev/inmo/micro_utils/coroutines/LaunchSynchronously.kt b/coroutines/src/jvmMain/kotlin/dev/inmo/micro_utils/coroutines/LaunchSynchronously.kt index 36e7d8b608a..d5142fcba7f 100644 --- a/coroutines/src/jvmMain/kotlin/dev/inmo/micro_utils/coroutines/LaunchSynchronously.kt +++ b/coroutines/src/jvmMain/kotlin/dev/inmo/micro_utils/coroutines/LaunchSynchronously.kt @@ -27,3 +27,6 @@ fun CoroutineScope.launchSynchronously(block: suspend CoroutineScope.() -> T } fun launchSynchronously(block: suspend CoroutineScope.() -> T): T = CoroutineScope(Dispatchers.Default).launchSynchronously(block) + +fun CoroutineScope.doSynchronously(block: suspend CoroutineScope.() -> T): T = launchSynchronously(block) +fun doSynchronously(block: suspend CoroutineScope.() -> T): T = launchSynchronously(block)