-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Dagger:
- In the
AppComponent, there isBuilderwhich can be replaced with theinterface Factory : AndroidInjector.Factory<MyApplication>asBuilderis deprecated in the latest version of Dagger. - The
fun inject(instance: MyApplication)can be removed asDaggerApplicationclass handles the field injections in theApplicationclass. - The
@BindsInstancefunction can be removed as theFactorygenerates this code for us.
Coroutines:
- We can use
withContext()function to switch threads in a coroutine instead of launching a new coroutine in separate thread each time. - Every function should handle the thread switching for proper execution of its body instead of relying on the caller of the function.
- There is no thread switching needed for the database operations if the function in Dao is marked as
suspend.Room uses a custom dispatcher optimised for the database operations.
zCode93
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed