Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@Module class AppModule(private val context: Context) {
@Provides fun providesAppContext() = context
@Provides fun providesAppDatabase(context: Context): AppDatabase =
Room.databaseBuilder(context,, "my-todo-db").allowMainThreadQueries().build()
@Provides fun providesToDoDao(database: AppDatabase) = database.taskDao()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment