mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-22 02:58:55 +02:00
Remove dependency injection from core module and data module from presentation-widget module
Includes side effects: - No longer need to restart app for user agent string change to take effect - parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
This commit is contained in:
@@ -9,9 +9,17 @@ class GetUpdates(
|
||||
private val repository: UpdatesRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(read: Boolean, after: Long): List<UpdatesWithRelations> {
|
||||
return repository.awaitWithRead(read, after)
|
||||
}
|
||||
|
||||
fun subscribe(calendar: Calendar): Flow<List<UpdatesWithRelations>> = subscribe(calendar.time.time)
|
||||
|
||||
fun subscribe(after: Long): Flow<List<UpdatesWithRelations>> {
|
||||
return repository.subscribeAll(after)
|
||||
}
|
||||
|
||||
fun subscribe(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
|
||||
return repository.subscribeWithRead(read, after)
|
||||
}
|
||||
}
|
||||
|
@@ -5,5 +5,9 @@ import tachiyomi.domain.updates.model.UpdatesWithRelations
|
||||
|
||||
interface UpdatesRepository {
|
||||
|
||||
suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations>
|
||||
|
||||
fun subscribeAll(after: Long): Flow<List<UpdatesWithRelations>>
|
||||
|
||||
fun subscribeWithRead(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>>
|
||||
}
|
||||
|
Reference in New Issue
Block a user