-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
๐:: [#153] ์ ์ฒด์ ์ธ ์๋ฒ ํต์ ํ๊ฒฝ ๊ตฌ์ถ #157
Conversation
MotivationMessageModel ์ ๊ทผ์ ์ด์ ์์ MyRoutineTableViewCell AddView ์ญ์
๋ชจ๋: Data
๋ชจ๋: HomeCoordintable
@@ -7,5 +7,5 @@ public protocol BaseViewModel { | |||
associatedtype Input | |||
associatedtype Output | |||
|
|||
func transform(_ input: Input) -> Output | |||
func transform(_ input: Input, action: (Output) -> Void) -> Output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input๊ณผ output์ฌ์ด์ ๋์์ ์ํ ๊ฒ์ธ๊ฐ์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output ํ์ ์ ์ธ์๋ก ๋ฐ์์ ๋ฐํ ํ์ ์ด Void์ธ ํจ์์ ๋๋ค
let output = viewModel.transform(input, action: { output in
output.stepNumber
.subscribe(onNext: { stepNumber in
MGLogger.debug("Step Number: (stepNumber)")
self.stepModels = stepNumber
})
.disposed(by: disposeBag)
output.motivationMessage
.subscribe(onNext: { message in
MGLogger.debug("Motivation Message: \(message)")
self.quotes = message
})
.disposed(by: disposeBag)
output.routines
.subscribe(onNext: { routines in
MGLogger.debug("Routines: \(routines)")
self.routines = routines
})
.disposed(by: disposeBag)
output.extras
.subscribe(onNext: { extras in
MGLogger.debug("Extras: \(extras)")
self.extras = extras
})
.disposed(by: disposeBag)
})
}
์์ ๊ฐ์ด ๋ฌถ์ด์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
28c0c4b4-ddf1-4518-96b1-da49c4ad1d40.mp4
์๋ฒ ๊ตฌ์ถ ์ฑ๊ณต