Skip to content

Commit

Permalink
ADD :: [#314] IntroViewModel
Browse files Browse the repository at this point in the history
googleButton alert 이벤트 추가
  • Loading branch information
Eunho0922 committed May 5, 2024
1 parent 9be42de commit c14eea8
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public class IntroViewModel: AuthViewModelType {

public struct Output {
var introDatas: Observable<IntroModel>
var showGoogleAlert: Observable<Void>
}

private let introModelSubject = PublishSubject<IntroModel>()
private let showGoogleAlertSubject = PublishSubject<Void>()

public init(authUseCase: AuthUseCase) {
self.useCase = authUseCase
Expand All @@ -46,15 +48,17 @@ public class IntroViewModel: AuthViewModelType {

public func transform(_ input: Input, action: (Output) -> Void) -> Output {

let output = Output(introDatas: introModelSubject.asObservable())
let output = Output(introDatas: introModelSubject.asObservable(), showGoogleAlert: showGoogleAlertSubject.asObservable())

action(output)

bindOutput(output: output)

input.goolgeButtonTapped
.drive(onNext: { _ in
print("googleButtonTapp")
.asObservable()
.withUnretained(self)
.subscribe(onNext: { owner, _ in
owner.showGoogleAlertSubject.onNext(())
})
.disposed(by: disposeBag)

Expand Down

0 comments on commit c14eea8

Please sign in to comment.