2022-04-23 05:29:24 +08:00
|
|
|
package eu.kanade.domain
|
|
|
|
|
|
|
|
import eu.kanade.data.history.HistoryRepositoryImpl
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.data.source.SourceRepositoryImpl
|
2022-04-23 05:29:24 +08:00
|
|
|
import eu.kanade.domain.history.interactor.DeleteHistoryTable
|
|
|
|
import eu.kanade.domain.history.interactor.GetHistory
|
|
|
|
import eu.kanade.domain.history.interactor.GetNextChapterForManga
|
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryById
|
|
|
|
import eu.kanade.domain.history.interactor.RemoveHistoryByMangaId
|
|
|
|
import eu.kanade.domain.history.repository.HistoryRepository
|
2022-04-25 02:35:59 +08:00
|
|
|
import eu.kanade.domain.source.interactor.DisableSource
|
|
|
|
import eu.kanade.domain.source.interactor.GetEnabledSources
|
|
|
|
import eu.kanade.domain.source.interactor.ToggleSourcePin
|
|
|
|
import eu.kanade.domain.source.repository.SourceRepository
|
2022-04-23 05:29:24 +08:00
|
|
|
import uy.kohesive.injekt.api.InjektModule
|
|
|
|
import uy.kohesive.injekt.api.InjektRegistrar
|
|
|
|
import uy.kohesive.injekt.api.addFactory
|
|
|
|
import uy.kohesive.injekt.api.addSingletonFactory
|
|
|
|
import uy.kohesive.injekt.api.get
|
|
|
|
|
|
|
|
class DomainModule : InjektModule {
|
|
|
|
|
|
|
|
override fun InjektRegistrar.registerInjectables() {
|
2022-04-25 04:16:05 +08:00
|
|
|
addFactory { GetNextChapterForManga(get()) }
|
|
|
|
|
2022-04-23 05:29:24 +08:00
|
|
|
addSingletonFactory<HistoryRepository> { HistoryRepositoryImpl(get()) }
|
|
|
|
addFactory { DeleteHistoryTable(get()) }
|
|
|
|
addFactory { GetHistory(get()) }
|
|
|
|
addFactory { RemoveHistoryById(get()) }
|
|
|
|
addFactory { RemoveHistoryByMangaId(get()) }
|
2022-04-25 04:16:05 +08:00
|
|
|
|
2022-04-25 02:35:59 +08:00
|
|
|
addSingletonFactory<SourceRepository> { SourceRepositoryImpl(get()) }
|
|
|
|
addFactory { GetEnabledSources(get(), get()) }
|
|
|
|
addFactory { DisableSource(get()) }
|
|
|
|
addFactory { ToggleSourcePin(get()) }
|
2022-04-23 05:29:24 +08:00
|
|
|
}
|
|
|
|
}
|