Skip to content

Commit

Permalink
feat: HomeViewModel에 DeleteBookCover UseCase 주입
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyxxn committed Dec 1, 2024
1 parent 1efc38f commit 8f60d0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
UpdateBookCoverUseCase.self,
object: DefaultUpdateBookCoverUseCase(repository: bookCoverRepository)
)
DIContainer.shared.register(
DeleteBookCoverUseCase.self,
object: DefaultDeleteBookCoverUseCase(repository: bookCoverRepository)
)
}

private func registerViewModelFactoryDependency() throws {
Expand All @@ -201,12 +205,14 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
let fetchMemorialHouseNameUseCase = try DIContainer.shared.resolve(FetchMemorialHouseNameUseCase.self)
let fetchAllBookCoverUseCase = try DIContainer.shared.resolve(FetchAllBookCoverUseCase.self)
let updateBookCoverUseCase = try DIContainer.shared.resolve(UpdateBookCoverUseCase.self)
let deleteBookCoverUseCase = try DIContainer.shared.resolve(DeleteBookCoverUseCase.self)
DIContainer.shared.register(
HomeViewModelFactory.self,
object: HomeViewModelFactory(
fetchMemorialHouseNameUseCase: fetchMemorialHouseNameUseCase,
fetchAllBookCoverUseCase: fetchAllBookCoverUseCase,
updateBookCoverUseCase: updateBookCoverUseCase
updateBookCoverUseCase: updateBookCoverUseCase,
deleteBookCoverUseCase: deleteBookCoverUseCase
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ public struct HomeViewModelFactory {
let fetchMemorialHouseNameUseCase: FetchMemorialHouseNameUseCase
let fetchAllBookCoverUseCase: FetchAllBookCoverUseCase
let updateBookCoverUseCase: UpdateBookCoverUseCase
let deleteBookCoverUseCase: DeleteBookCoverUseCase

public init(
fetchMemorialHouseNameUseCase: FetchMemorialHouseNameUseCase,
fetchAllBookCoverUseCase: FetchAllBookCoverUseCase,
updateBookCoverUseCase: UpdateBookCoverUseCase
updateBookCoverUseCase: UpdateBookCoverUseCase,
deleteBookCoverUseCase: DeleteBookCoverUseCase
) {
self.fetchMemorialHouseNameUseCase = fetchMemorialHouseNameUseCase
self.fetchAllBookCoverUseCase = fetchAllBookCoverUseCase
self.updateBookCoverUseCase = updateBookCoverUseCase
self.deleteBookCoverUseCase = deleteBookCoverUseCase
}

public func make() -> HomeViewModel {
HomeViewModel(
fetchMemorialHouseUseCase: fetchMemorialHouseNameUseCase,
fetchAllBookCoverUseCase: fetchAllBookCoverUseCase,
updateBookCoverUseCase: updateBookCoverUseCase
updateBookCoverUseCase: updateBookCoverUseCase,
deleteBookCoverUseCase: deleteBookCoverUseCase
)
}
}

0 comments on commit 8f60d0c

Please sign in to comment.