refactor: Move file that supposed to be in common

Also rename launchNonCancellable to launchNonCancellableIO and change the comment in LibraryPresenter to be more accurate.
This commit is contained in:
Ahmad Ansori Palembani 2024-06-20 09:28:46 +07:00
parent 8cfe5a1182
commit ff08e19880
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
6 changed files with 16 additions and 16 deletions

View file

@ -28,7 +28,7 @@ fun CoroutineScope.launchIO(block: suspend CoroutineScope.() -> Unit): Job =
fun CoroutineScope.launchUI(block: suspend CoroutineScope.() -> Unit): Job =
launch(Dispatchers.Main, block = block)
fun CoroutineScope.launchNonCancellable(block: suspend CoroutineScope.() -> Unit): Job =
fun CoroutineScope.launchNonCancellableIO(block: suspend CoroutineScope.() -> Unit): Job =
launchIO { withContext(NonCancellable, block) }
suspend fun <T> withUIContext(block: suspend CoroutineScope.() -> T) = withContext(Dispatchers.Main, block)