{"action":"created","comment":{"url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/comments/221811204","pull_request_review_id":160549893,"id":221811204,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTgxMTIwNA==","diff_hunk":"@@ -1,22 +1,137 @@\n package moviedb.cleanarchitecture.com.framgia.moviedb.screen.home\n \n+import android.arch.lifecycle.MutableLiveData\n import android.util.Log\n import io.reactivex.android.schedulers.AndroidSchedulers\n import io.reactivex.disposables.CompositeDisposable\n import io.reactivex.functions.Consumer\n import io.reactivex.schedulers.Schedulers\n+import moviedb.cleanarchitecture.com.framgia.domain.usecase.genre.GenreUseCase\n import moviedb.cleanarchitecture.com.framgia.domain.usecase.movie.NowPlayingUseCase\n import moviedb.cleanarchitecture.com.framgia.domain.usecase.movie.PopularUseCase\n import moviedb.cleanarchitecture.com.framgia.domain.usecase.movie.TopRatedUseCase\n import moviedb.cleanarchitecture.com.framgia.domain.usecase.movie.UpComingUseCase\n import moviedb.cleanarchitecture.com.framgia.moviedb.base.BaseViewModel\n+import moviedb.cleanarchitecture.com.framgia.moviedb.model.GenreItem\n+import moviedb.cleanarchitecture.com.framgia.moviedb.model.GenreItemMapper\n+import moviedb.cleanarchitecture.com.framgia.moviedb.model.MovieItem\n+import moviedb.cleanarchitecture.com.framgia.moviedb.model.MovieItemMapper\n import moviedb.cleanarchitecture.com.framgia.moviedb.rx.ScheduleProvider\n \n class HomeViewModel(\n+        val genreUseCase: GenreUseCase,\n         val nowPlayingUseCase: NowPlayingUseCase,\n         val popularUseCase: PopularUseCase,\n         val topRatedUseCase: TopRatedUseCase,\n         val upComingUseCase: UpComingUseCase,\n         val schedulerProvider: ScheduleProvider,\n-        val compositeDisposable: CompositeDisposable\n-) : BaseViewModel()\n+        val compositeDisposable: CompositeDisposable,\n+        val genreItemMapper: GenreItemMapper,\n+        val movieItemMapper: MovieItemMapper\n+) : BaseViewModel() {\n+    var isLoadGenreSucees = false\n+    var isLoadNowPlayingSucess = false\n+    var isLoadPopularSucess = false\n+    var isLoadTopRatedSucess = false\n+    var isLoadUpcomingSucess = false\n+    val isLoading = MutableLiveData<Boolean>()\n+    val listGenre = MutableLiveData<List<GenreItem>>()\n+    val listNowPlaying = MutableLiveData<List<MovieItem>>()\n+    val listPopular = MutableLiveData<List<MovieItem>>()\n+    val listTopRated = MutableLiveData<List<MovieItem>>()\n+    val listUpComing = MutableLiveData<List<MovieItem>>()\n+    fun getData() {\n+        compositeDisposable.apply {\n+            isLoading.value = true\n+            add(genreUseCase.createObservable(GenreUseCase.Params())","path":"presentation/src/main/java/moviedb/cleanarchitecture/com/framgia/moviedb/screen/home/HomeViewModel.kt","position":48,"original_position":48,"commit_id":"df564f89cd4e790e61472179891732f9987a7c9c","original_commit_id":"d9b6a29d5261c6ff7ff5edb36f61dce3d5599dd5","user":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"body":"bởi vì hàm này em sử dụng cả các biên global để thêm vào các hàm của rx nên nếu tách ra một hàm riêng cho gọn thì phải inject khá nhiều param vào function nên em nghĩ là sẽ rối mắt ạ","created_at":"2018-10-02T02:30:03Z","updated_at":"2018-10-02T02:30:03Z","html_url":"https://github.com/hoangth1/MovieDB/pull/9#discussion_r221811204","pull_request_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/comments/221811204"},"html":{"href":"https://github.com/hoangth1/MovieDB/pull/9#discussion_r221811204"},"pull_request":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9"}},"in_reply_to_id":221810223},"pull_request":{"url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9","id":219564846,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5NTY0ODQ2","html_url":"https://github.com/hoangth1/MovieDB/pull/9","diff_url":"https://github.com/hoangth1/MovieDB/pull/9.diff","patch_url":"https://github.com/hoangth1/MovieDB/pull/9.patch","issue_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/9","number":9,"state":"open","locked":false,"title":"fill data","user":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-02T01:57:52Z","updated_at":"2018-10-02T02:30:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0da097f163b3362ba0105f16c986337380a3ec93","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9/commits","review_comments_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9/comments","review_comment_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/9/comments","statuses_url":"https://api.github.com/repos/hoangth1/MovieDB/statuses/df564f89cd4e790e61472179891732f9987a7c9c","head":{"label":"hoangth1:fill_data","ref":"fill_data","sha":"df564f89cd4e790e61472179891732f9987a7c9c","user":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"repo":{"id":150521861,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA1MjE4NjE=","name":"MovieDB","full_name":"hoangth1/MovieDB","private":false,"owner":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hoangth1/MovieDB","description":null,"fork":false,"url":"https://api.github.com/repos/hoangth1/MovieDB","forks_url":"https://api.github.com/repos/hoangth1/MovieDB/forks","keys_url":"https://api.github.com/repos/hoangth1/MovieDB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoangth1/MovieDB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoangth1/MovieDB/teams","hooks_url":"https://api.github.com/repos/hoangth1/MovieDB/hooks","issue_events_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/events{/number}","events_url":"https://api.github.com/repos/hoangth1/MovieDB/events","assignees_url":"https://api.github.com/repos/hoangth1/MovieDB/assignees{/user}","branches_url":"https://api.github.com/repos/hoangth1/MovieDB/branches{/branch}","tags_url":"https://api.github.com/repos/hoangth1/MovieDB/tags","blobs_url":"https://api.github.com/repos/hoangth1/MovieDB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoangth1/MovieDB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoangth1/MovieDB/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoangth1/MovieDB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoangth1/MovieDB/statuses/{sha}","languages_url":"https://api.github.com/repos/hoangth1/MovieDB/languages","stargazers_url":"https://api.github.com/repos/hoangth1/MovieDB/stargazers","contributors_url":"https://api.github.com/repos/hoangth1/MovieDB/contributors","subscribers_url":"https://api.github.com/repos/hoangth1/MovieDB/subscribers","subscription_url":"https://api.github.com/repos/hoangth1/MovieDB/subscription","commits_url":"https://api.github.com/repos/hoangth1/MovieDB/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoangth1/MovieDB/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoangth1/MovieDB/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoangth1/MovieDB/contents/{+path}","compare_url":"https://api.github.com/repos/hoangth1/MovieDB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoangth1/MovieDB/merges","archive_url":"https://api.github.com/repos/hoangth1/MovieDB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoangth1/MovieDB/downloads","issues_url":"https://api.github.com/repos/hoangth1/MovieDB/issues{/number}","pulls_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls{/number}","milestones_url":"https://api.github.com/repos/hoangth1/MovieDB/milestones{/number}","notifications_url":"https://api.github.com/repos/hoangth1/MovieDB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoangth1/MovieDB/labels{/name}","releases_url":"https://api.github.com/repos/hoangth1/MovieDB/releases{/id}","deployments_url":"https://api.github.com/repos/hoangth1/MovieDB/deployments","created_at":"2018-09-27T03:12:06Z","updated_at":"2018-10-01T09:23:07Z","pushed_at":"2018-10-02T02:25:57Z","git_url":"git://github.com/hoangth1/MovieDB.git","ssh_url":"git@github.com:hoangth1/MovieDB.git","clone_url":"https://github.com/hoangth1/MovieDB.git","svn_url":"https://github.com/hoangth1/MovieDB","homepage":null,"size":181,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"hoangth1:develop","ref":"develop","sha":"421f174cb009b4ca02dbef993460ea717e5f93b6","user":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"repo":{"id":150521861,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA1MjE4NjE=","name":"MovieDB","full_name":"hoangth1/MovieDB","private":false,"owner":{"login":"hoangth1","id":39363555,"node_id":"MDQ6VXNlcjM5MzYzNTU1","avatar_url":"https://avatars3.githubusercontent.com/u/39363555?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangth1","html_url":"https://github.com/hoangth1","followers_url":"https://api.github.com/users/hoangth1/followers","following_url":"https://api.github.com/users/hoangth1/following{/other_user}","gists_url":"https://api.github.com/users/hoangth1/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangth1/subscriptions","organizations_url":"https://api.github.com/users/hoangth1/orgs","repos_url":"https://api.github.com/users/hoangth1/repos","events_url":"https://api.github.com/users/hoangth1/events{/privacy}","received_events_url":"https://api.github.com/users/hoangth1/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hoangth1/MovieDB","description":null,"fork":false,"url":"https://api.github.com/repos/hoangth1/MovieDB","forks_url":"https://api.github.com/repos/hoangth1/MovieDB/forks","keys_url":"https://api.github.com/repos/hoangth1/MovieDB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoangth1/MovieDB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoangth1/MovieDB/teams","hooks_url":"https://api.github.com/repos/hoangth1/MovieDB/hooks","issue_events_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/events{/number}","events_url":"https://api.github.com/repos/hoangth1/MovieDB/events","assignees_url":"https://api.github.com/repos/hoangth1/MovieDB/assignees{/user}","branches_url":"https://api.github.com/repos/hoangth1/MovieDB/branches{/branch}","tags_url":"https://api.github.com/repos/hoangth1/MovieDB/tags","blobs_url":"https://api.github.com/repos/hoangth1/MovieDB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoangth1/MovieDB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoangth1/MovieDB/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoangth1/MovieDB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoangth1/MovieDB/statuses/{sha}","languages_url":"https://api.github.com/repos/hoangth1/MovieDB/languages","stargazers_url":"https://api.github.com/repos/hoangth1/MovieDB/stargazers","contributors_url":"https://api.github.com/repos/hoangth1/MovieDB/contributors","subscribers_url":"https://api.github.com/repos/hoangth1/MovieDB/subscribers","subscription_url":"https://api.github.com/repos/hoangth1/MovieDB/subscription","commits_url":"https://api.github.com/repos/hoangth1/MovieDB/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoangth1/MovieDB/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoangth1/MovieDB/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoangth1/MovieDB/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoangth1/MovieDB/contents/{+path}","compare_url":"https://api.github.com/repos/hoangth1/MovieDB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoangth1/MovieDB/merges","archive_url":"https://api.github.com/repos/hoangth1/MovieDB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoangth1/MovieDB/downloads","issues_url":"https://api.github.com/repos/hoangth1/MovieDB/issues{/number}","pulls_url":"https://api.github.com/repos/hoangth1/MovieDB/pulls{/number}","milestones_url":"https://api.github.com/repos/hoangth1/MovieDB/milestones{/number}","notifications_url":"https://api.github.com/repos/hoangth1/MovieDB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoangth1/MovieDB/labels{/name}","releases_url":"https://api.github.com/repos/hoangth1/MovieDB/releases{/id}","deployments_url":"https://api.github.com/repos/hoangth1/MovieDB/deployments","created_at":"2018-09-27T03:12:06Z","updated_at":"2018-10-01T09:23:07Z","pushed_at":"2018-10-02T02:25:57Z","git_url":"git://github.com/hoangth1/MovieDB.git","ssh_url":"git@github.com:hoangth1/MovieDB.git","clone_url":"https://github.com/hoangth1/MovieDB.git","svn_url":"https://github.com/hoangth1/MovieDB","homepage":null,"size":181,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9"},"html":{"href":"https://github.com/hoangth1/MovieDB/pull/9"},"issue":{"href":"https://api.github.com/repos/hoangth1/MovieDB/issues/9"},"comments":{"href":"https://api.github.com/repos/hoangth1/MovieDB/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hoangth1/MovieDB/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/hoangth1/MovieDB/statuses/df564f89cd4e790e61472179891732f9987a7c9c"}},"author_association":"OWNER"}}
{"actor":{"display_login":"hoangth1"}}