mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 17:37:05 +05:30
refactor(database): expose *Queries
objects to the DI graph
This commit is contained in:
parent
44438da292
commit
edadcc6744
4 changed files with 37 additions and 10 deletions
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright © 2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.database.injection
|
||||
|
||||
import com.deliveryhero.whetstone.app.ApplicationScope
|
||||
import com.squareup.anvil.annotations.ContributesTo
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dev.msfjarvis.claw.database.LobstersDatabase
|
||||
import dev.msfjarvis.claw.database.local.PostCommentsQueries
|
||||
import dev.msfjarvis.claw.database.local.SavedPostQueries
|
||||
|
||||
@Module
|
||||
@ContributesTo(ApplicationScope::class)
|
||||
object QueriesModule {
|
||||
|
||||
@Provides
|
||||
fun provideSavedPostsQueries(database: LobstersDatabase): SavedPostQueries {
|
||||
return database.savedPostQueries
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun providePostCommentsQueries(database: LobstersDatabase): PostCommentsQueries {
|
||||
return database.postCommentsQueries
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue