๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol MonkeyInteractorLogic: class { | |
| var request: PublishRelay<MonkeyModel.Request> { get set } | |
| } | |
| class MonkeyInteractor: MonkeyInteractorLogic { | |
| var presenter: MonkeyPresenterLogic? { | |
| get { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct MonkeyModel { | |
| struct Request { | |
| } | |
| struct Response { | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Interactor์ input๊ณผ output์ ๋ํ RxTest์งํ | |
| ์ด๋ ํ Request ์ด๋ฒคํธ ๋ฐ์์ ๊ธฐ๋ํ๋ Response ์ด๋ฒคํธ๋ฅผ ๋ฐ๋์ง? | |
| Worker๋ Stub์ผ๋ก ์์ฑํ์ฌ Interactor์ ์ฃผ์ | |
| */ | |
| class InteractorTests: XCTestCase { | |
| var interactor: Interactor! | |
| var disposeBag: DisposeBag! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CellNode: ASCellNode { | |
| let contentNode = ASDisplayNode() | |
| override init() { | |
| super.init() | |
| self.ASM = true | |
| self.contentNode.ASM = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Cell: ASCellNode { | |
| let messageCountNode = ASButtonNode() | |
| let likeCountNode = ASButtonNode() | |
| func engageAreaLayoutSpec() -> ASLayoutSpec { | |
| let stackLayout = ASStackLayoutSpec(children: [message....like]) | |
| return ASInsetLayoutSpec(insets: .init(top: 0, left: .inf, bottom: 0, right: 0, child: stackLayout) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol AnimalFeedInputLogics { | |
| // ํผ๋ ๋ฉ์ปค๋์ฆ์ ๋ํ ๋น์ฆ๋์ค ๋ก์ง๋ง ์ํํ ์ ์๊ฒ ๋ทฐ์ปจ์ผ๋ก ๋ถํฐ ์ด๋ฒคํธ๋ฅผ ๋ฐ๋ ๋ก์ง | |
| var loadAnimalItem: PublishRelay<NextPage> { get } // Load more animation cell items | |
| } | |
| protocol AnimalCatCellInputLogics { | |
| // ์ค์ง ๊ณ ์์ด ์ ๋ก ๋ถํฐ ์ด๋ฒคํธ๋ฅผ ๋ฐ๋ ๋ก์ง | |
| var didTapFollow: PublishRelay<Int> { get } // Int: Cat identifier | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ReactiveTestCellNode: ASCellNode { | |
| public var viewState: ActionRelay<State> = .init() | |
| func state() { | |
| viewState.map { $0.title } | |
| .distinguishUntilChanged() | |
| .bind(to: titleNode.rx.title, setNeedsLayout: self) | |
| .disposed(by: disposeBag) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TestViewController { | |
| let userInputView = InputView() | |
| let displayOutputView: OutputView() | |
| func bind() { | |
| let state = Presenter.shared.state(type: OutputViewState.self, id: 1) | |
| state.map { $0.title }.bind(to: displayOutputView.rx.title).disposed(by: bag) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DisplayCellNode: ASCellNode { | |
| // UI | |
| let buttonNode = ASButtonNode() | |
| // Props | |
| weak var interactor: InteractorLogics! | |
| private var presenter: DisplayCellPresenter = .init() | |
| override func didLoad() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GlobalHook { | |
| static let shared = GlobalHook() | |
| var updateModel = PublishRelay<Model>() | |
| } | |
| protcol ViewModelProcotol { | |
| func hook() | |
| } |