Last active
December 18, 2018 14:07
-
-
Save leandroBorgesFerreira/fa5996cca0fb85bb3daaafeb7ce2507e to your computer and use it in GitHub Desktop.
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 MainActivity : AppCompatActivity(), RepositoriesView { | |
| private val repoList: MutableList<Repository> = mutableListOf() | |
| lateinit var presenter: RepositoryPresenter<ForObservableK> | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| setupList(repoList) | |
| presenter = initPresenter(ObservableK.async()) | |
| presenter | |
| .drawRepositories() | |
| .fix() | |
| .observable | |
| .subscribe() | |
| } | |
| } | |
| private fun <F> initPresenter(async: Async<F>) = | |
| RepositoryDataSource(async, apiClient()) pipe { dataSource -> | |
| RepositoryUseCase(dataSource) | |
| } pipe { useCase -> | |
| RepositoryPresenter(useCase, this) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment