mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 19:57:04 +05:30
refactor(di): replace Tangle with Whetstone
This commit is contained in:
parent
4a87682b68
commit
0232a4179a
23 changed files with 36 additions and 188 deletions
|
@ -9,6 +9,7 @@ package dev.msfjarvis.claw.database.injection
|
|||
import android.content.Context
|
||||
import app.cash.sqldelight.adapter.primitive.IntColumnAdapter
|
||||
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
|
||||
import com.deliveryhero.whetstone.ForScope
|
||||
import com.deliveryhero.whetstone.app.ApplicationScope
|
||||
import com.squareup.anvil.annotations.ContributesTo
|
||||
import dagger.Module
|
||||
|
@ -24,7 +25,7 @@ object DatabaseModule {
|
|||
private const val LOBSTERS_DATABASE_NAME = "SavedPosts.db"
|
||||
|
||||
@Provides
|
||||
fun provideDatabase(context: Context): LobstersDatabase {
|
||||
fun provideDatabase(@ForScope(ApplicationScope::class) context: Context): LobstersDatabase {
|
||||
val driver = AndroidSqliteDriver(LobstersDatabase.Schema, context, LOBSTERS_DATABASE_NAME)
|
||||
return LobstersDatabase(driver, SavedPost.Adapter(IntColumnAdapter, TagsAdapter()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue