Created
May 24, 2021 18:48
-
-
Save barbeau/e0b3a7a6e7195f38ed932712721029a4 to your computer and use it in GitHub Desktop.
Medium article - Room + Flow for location updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module | |
@InstallIn(SingletonComponent::class) | |
object DataModule { | |
@Provides | |
@Singleton | |
fun provideDatabase(@ApplicationContext context: Context): LocationDatabase = | |
LocationDatabase.create(context) | |
@Provides | |
fun provideDao(database: LocationDatabase): LocationDao { | |
return database.locationDao() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment