- Add protocols for all UseCases and implement them in their respective classes - Add DefaultUseCaseFactory and MockUseCaseFactory for dependency injection - Implement all mock UseCases with dummy data - Start migration of view models and views to protocol-based UseCase injection (not all migrated yet) - Refactor previews and some initializers for easier testing - Move SectionHeader to Components, update server settings UI text - Add sample article.html for mock content
18 lines
427 B
Swift
18 lines
427 B
Swift
import Foundation
|
|
|
|
protocol PGetLabelsUseCase {
|
|
func execute() async throws -> [BookmarkLabel]
|
|
}
|
|
|
|
class GetLabelsUseCase: PGetLabelsUseCase {
|
|
private let labelsRepository: PLabelsRepository
|
|
|
|
init(labelsRepository: PLabelsRepository) {
|
|
self.labelsRepository = labelsRepository
|
|
}
|
|
|
|
func execute() async throws -> [BookmarkLabel] {
|
|
return try await labelsRepository.getLabels()
|
|
}
|
|
}
|