Last active
April 17, 2021 10:31
-
-
Save isaac-weisberg/b53d460394f6f18f3cb7b1a7d0c595ce to your computer and use it in GitHub Desktop.
This file contains 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 TransactionTableViewModel { | |
// ... omitted ... | |
init(di: DI) { | |
self.transactionViewModels = di.transactionListService.getTransactionModels() | |
.map { transactionModel -> TransactionCellViewModel in | |
if transactionModel.isPendingAccept { | |
let viewModel = TransactionInfoWAcceptViewModel(model: transactionModel) | |
viewModel.acceptButtonTap | |
.map { _ in | |
transactionModel.id | |
} | |
.bind(to: navigation.showTransactionAcceptScreen) | |
.disposed(by: viewModel.disposeBag) | |
return .infoPendingAccept(viewModel) | |
} | |
let viewModel = TransactionInfoCellViewModel(model: transactionModel) | |
return .info(viewModel) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment