Skip to content

Commit

Permalink
[Feat] sopt-makers#57 - Domain Layer 구현 및 VC와 바인딩
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Dec 26, 2022
1 parent 4eed4d3 commit 8ffe786
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ extension DefaultPasswordChangeUseCase: PasswordChangeUseCase {
}

public func changePassword(password: String) {
// repository 연결
repository.changePassword(password: password)
.sink { event in
print("PasswordChangeUseCase: \(event)")
} receiveValue: { isSuccess in
self.passwordChangeSuccess.send(isSuccess)
}.store(in: cancelBag)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ extension PasswordChangeVC {
print(isSuccess)
}.store(in: cancelBag)
}

}

// MARK: - UI & Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ extension PasswordChangeViewModel {
}.store(in: self.cancelBag)

input.passwordChangeButtonTapped
.sink { signUpRequest in
// 버튼 클릭 액션
.sink { password in
self.useCase.changePassword(password: password)
}.store(in: self.cancelBag)

return output
Expand All @@ -88,5 +88,11 @@ extension PasswordChangeViewModel {
} receiveValue: { isValidForm in
output.isValidForm.send(isValidForm)
}.store(in: cancelBag)

useCase.passwordChangeSuccess.sink { event in
print("PasswordChangeViewModel - completion: \(event)")
} receiveValue: { isSuccess in
output.passwordChangeSuccessed.send(isSuccess)
}.store(in: cancelBag)
}
}

0 comments on commit 8ffe786

Please sign in to comment.