Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class GitRepoRepository {
  2.  
  3. val localDataSource = GitRepoLocalDataSource()
  4. val remoteDataSource = GitRepoRemoteDataSource()
  5.  
  6. fun getRepositories(onRepositoryReadyCallback: OnRepositoryReadyCallback) {
  7. remoteDataSource.getRepositories( object : OnRepoRemoteReadyCallback {
  8. override fun onDataReady(data: ArrayList<Repository>) {
  9. localDataSource.saveRepositories(data)
  10. onRepositoryReadyCallback.onDataReady(data)
  11. }
  12.  
  13. })
  14. }
  15. }
  16.  
  17. interface OnRepositoryReadyCallback {
  18. fun onDataReady(data: ArrayList<Repository>)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement