mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 03:27:10 +00:00
feat(folio-core): annotate Repository and SqlLedgerStore with @Inject
This commit is contained in:
1 parent
26c1b9db74
commit
4bc8da8ee1
2 files changed
+4
No files matched your search
@@ -1,8 +1,10 @@
|
||||
package app.folio.core.data
|
||||
|
||||
import app.folio.core.platform.Platform
|
||||
import dev.zacsweers.metro.Inject
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
@Inject
|
||||
class Repository(private val store: LedgerStore) {
|
||||
val accounts: StateFlow<List<Account>> = store.accounts
|
||||
val transactions: StateFlow<List<Transaction>> = store.transactions
|
||||
|
||||
@@ -5,6 +5,7 @@ import app.cash.sqldelight.coroutines.asFlow
|
||||
import app.cash.sqldelight.coroutines.mapToList
|
||||
import app.cash.sqldelight.coroutines.mapToOneOrNull
|
||||
import app.folio.db.LedgerDatabase
|
||||
import dev.zacsweers.metro.Inject
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
@@ -13,6 +14,7 @@ import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.stateIn
|
||||
|
||||
@Inject
|
||||
class SqlLedgerStore(db: LedgerDatabase) : LedgerStore {
|
||||
private val queries = db.ledgerQueries
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
||||
|
||||
Reference in new issue
Block a user