Skip to content

Commit

Permalink
[Fix] #388 - target 변경 및 withUnretained 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Sep 27, 2024
1 parent ccd2af2 commit 23d94f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ public class DefaultDailySoptuneUseCase {
extension DefaultDailySoptuneUseCase: DailySoptuneUseCase {
public func getDailySoptuneResult(date: String) {
repository.getDailySoptuneResult(date: date)
.withUnretained(self)
.sink { event in
print("GetDailySoptuneResult State: \(event)")
} receiveValue: { [weak self] dailySoptuneResult in
self?.dailySoptuneResult.send(dailySoptuneResult)
} receiveValue: { _, resultModel in
self.dailySoptuneResult.send(resultModel)
}
.store(in: cancelBag)

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ public final class DailySoptuneMainViewModel: DailySoptuneMainViewModelType {
let viewDidLoad: Driver<Void>
let naviBackButtonTap: Driver<Void>
let receiveTodayFortuneButtonTap: Driver<Void>

public init(viewDidLoad: Driver<Void>, naviBackButtonTap: Driver<Void>, receiveTodayFortuneButtonTap: Driver<Void>) {
self.viewDidLoad = viewDidLoad
self.naviBackButtonTap = naviBackButtonTap
self.receiveTodayFortuneButtonTap = receiveTodayFortuneButtonTap
}
}

// MARK: - Outputs
Expand Down

0 comments on commit 23d94f4

Please sign in to comment.