Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dispatchers.Main.immediate instead of Dispatchers.Main for ScreenModel's coroutineScope #216

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

mr3y-the-programmer
Copy link
Contributor

There is no need to do unnecessary dispatching using Dispatchers.Main since ScreenModel's operations are intended to run immediately on the main thread, this matches what AndroidX ViewModel is doing for viewModelScope property.
Also, Dispatcher.Main.immediate is available on Android, Apple platforms, Web (JS), JavaFX(Desktop). So, it should be safe to use it in the commonMain

@DevNatan
Copy link
Collaborator

Nice catch @mr3y-the-programmer!! Thanks :)

@DevNatan DevNatan merged commit 4e46eb8 into adrielcafe:main Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants