refactor: app 组合根与导航

This commit is contained in:
AndyChen1024
2026-09-14 21:10:44 +08:00
parent b5de8ddfbd
commit 653caa0b84
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import CoreDomain
import CoreRepository
import FeatureHome
/// 手写组合根 / DI 容器(对应 Android Hilt 的 AppContainer)。
@MainActor
public enum AppContainer {
/// 装配 FeatureHome 依赖并返回 ViewModel。
public static func makeHomeViewModel() -> HomeViewModel {
let repository: HomeRepository = FakeHomeRepository()
let useCase = HomeUseCase(repository: repository)
return HomeViewModel(homeUseCase: useCase)
}
}