{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/comments/206746769","pull_request_review_id":142218271,"id":206746769,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjc0Njc2OQ==","diff_hunk":"@@ -0,0 +1,90 @@\n+//\n+//  SearchViewModel.swift\n+//  TheMoviesReal\n+//\n+//  Created by Hai on 7/29/18.\n+//  Copyright © 2018 Hai. All rits reserved.\n+//\n+\n+import Foundation\n+import RxSwift\n+import RxCocoa\n+import NSObject_Rx\n+\n+struct SearchViewModel: ViewModelType {\n+    struct  Input {\n+        let queryTrigger: Driver<String>\n+        let loadTrigger: Driver<Void>\n+        let reloadTrigger: Driver<Void>\n+        let loadMoreTrigger: Driver<Void>\n+        let selectMovieTrigger: Driver<IndexPath>\n+    }\n+    \n+    struct Output {\n+        let movieList: Driver<[Movie]>\n+        let loading: Driver<Bool>\n+        let refreshing: Driver<Bool>\n+        let loadingMore: Driver<Bool>\n+        let fetchItem: Driver<Void>\n+        let error: Driver<Error>\n+        let selectedMovie: Driver<Void>\n+        let isEmptyData: Driver<Bool>\n+    }\n+    \n+    let navigator: SearchNavigatorType\n+    let useCase: SearchUseCaseType\n+    \n+    func transform(_ input: SearchViewModel.Input) -> SearchViewModel.Output {\n+        let loadMoreOutput = setupLoadMorePagingWithParam(\n+            loadTrigger: input.queryTrigger,\n+            getItems: { query -> Observable<PagingInfo<Movie>> in\n+                self.useCase.getMovieList(query: query)\n+        },\n+            refreshTrigger: input.reloadTrigger.withLatestFrom(input.queryTrigger),\n+            refreshItems: { query -> Observable<PagingInfo<Movie>> in\n+                self.useCase.getMovieList(query: query)\n+        },\n+            loadMoreTrigger: input.loadMoreTrigger.withLatestFrom(input.queryTrigger),\n+            loadMoreItems: { query, page -> Observable<PagingInfo<Movie>> in\n+                self.useCase.loadMoreMovieList(query: query, page: page)\n+        }\n+        )\n+        let (page, fetchItem, loadError, Loading, refreshing, loadingMore) = loadMoreOutput\n+        \n+        let movieList = page\n+            .map { PagingInfo in\n+                return PagingInfo.items\n+        }\n+        .asDriverOnErrorJustComplete()\n+        \n+        let selectedMovie = input.selectMovieTrigger\n+            .withLatestFrom(movieList) { indexPath, movieList in\n+                return (indexPath, movieList)\n+            }\n+            .map { (indexPath, movieList) in\n+                return movieList[indexPath.row]\n+            }\n+            .do(onNext: { movie in","path":"TheMoviesReal/TheMoviesReal/Scene/Search Screen/SearchViewModel.swift","position":67,"original_position":67,"commit_id":"d9742a0afe62c7d91e168006e0d6aca3b94b83b2","original_commit_id":"d9742a0afe62c7d91e168006e0d6aca3b94b83b2","user":{"login":"framgia-nguyenkdm","id":37788955,"node_id":"MDQ6VXNlcjM3Nzg4OTU1","avatar_url":"https://avatars3.githubusercontent.com/u/37788955?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia-nguyenkdm","html_url":"https://github.com/framgia-nguyenkdm","followers_url":"https://api.github.com/users/framgia-nguyenkdm/followers","following_url":"https://api.github.com/users/framgia-nguyenkdm/following{/other_user}","gists_url":"https://api.github.com/users/framgia-nguyenkdm/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia-nguyenkdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia-nguyenkdm/subscriptions","organizations_url":"https://api.github.com/users/framgia-nguyenkdm/orgs","repos_url":"https://api.github.com/users/framgia-nguyenkdm/repos","events_url":"https://api.github.com/users/framgia-nguyenkdm/events{/privacy}","received_events_url":"https://api.github.com/users/framgia-nguyenkdm/received_events","type":"User","site_admin":false},"body":"phần này em có làm gì không nhỉ sao thấy để trống không làm gì nè ","created_at":"2018-08-01T03:35:50Z","updated_at":"2018-08-01T03:36:16Z","html_url":"https://github.com/framgia/IOS_MovieDB_02/pull/13#discussion_r206746769","pull_request_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/comments/206746769"},"html":{"href":"https://github.com/framgia/IOS_MovieDB_02/pull/13#discussion_r206746769"},"pull_request":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13","id":205298138,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1Mjk4MTM4","html_url":"https://github.com/framgia/IOS_MovieDB_02/pull/13","diff_url":"https://github.com/framgia/IOS_MovieDB_02/pull/13.diff","patch_url":"https://github.com/framgia/IOS_MovieDB_02/pull/13.patch","issue_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/13","number":13,"state":"open","locked":false,"title":"Update search screen","user":{"login":"HoangHai2401","id":25085840,"node_id":"MDQ6VXNlcjI1MDg1ODQw","avatar_url":"https://avatars0.githubusercontent.com/u/25085840?v=4","gravatar_id":"","url":"https://api.github.com/users/HoangHai2401","html_url":"https://github.com/HoangHai2401","followers_url":"https://api.github.com/users/HoangHai2401/followers","following_url":"https://api.github.com/users/HoangHai2401/following{/other_user}","gists_url":"https://api.github.com/users/HoangHai2401/gists{/gist_id}","starred_url":"https://api.github.com/users/HoangHai2401/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoangHai2401/subscriptions","organizations_url":"https://api.github.com/users/HoangHai2401/orgs","repos_url":"https://api.github.com/users/HoangHai2401/repos","events_url":"https://api.github.com/users/HoangHai2401/events{/privacy}","received_events_url":"https://api.github.com/users/HoangHai2401/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-01T03:19:37Z","updated_at":"2018-08-01T03:36:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bae3461239b5dc82bf28221c8593374924e61ed6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13/commits","review_comments_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13/comments","review_comment_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/13/comments","statuses_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/statuses/d9742a0afe62c7d91e168006e0d6aca3b94b83b2","head":{"label":"HoangHai2401:Search_screen","ref":"Search_screen","sha":"d9742a0afe62c7d91e168006e0d6aca3b94b83b2","user":{"login":"HoangHai2401","id":25085840,"node_id":"MDQ6VXNlcjI1MDg1ODQw","avatar_url":"https://avatars0.githubusercontent.com/u/25085840?v=4","gravatar_id":"","url":"https://api.github.com/users/HoangHai2401","html_url":"https://github.com/HoangHai2401","followers_url":"https://api.github.com/users/HoangHai2401/followers","following_url":"https://api.github.com/users/HoangHai2401/following{/other_user}","gists_url":"https://api.github.com/users/HoangHai2401/gists{/gist_id}","starred_url":"https://api.github.com/users/HoangHai2401/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoangHai2401/subscriptions","organizations_url":"https://api.github.com/users/HoangHai2401/orgs","repos_url":"https://api.github.com/users/HoangHai2401/repos","events_url":"https://api.github.com/users/HoangHai2401/events{/privacy}","received_events_url":"https://api.github.com/users/HoangHai2401/received_events","type":"User","site_admin":false},"repo":{"id":141993358,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE5OTMzNTg=","name":"IOS_MovieDB_02","full_name":"HoangHai2401/IOS_MovieDB_02","owner":{"login":"HoangHai2401","id":25085840,"node_id":"MDQ6VXNlcjI1MDg1ODQw","avatar_url":"https://avatars0.githubusercontent.com/u/25085840?v=4","gravatar_id":"","url":"https://api.github.com/users/HoangHai2401","html_url":"https://github.com/HoangHai2401","followers_url":"https://api.github.com/users/HoangHai2401/followers","following_url":"https://api.github.com/users/HoangHai2401/following{/other_user}","gists_url":"https://api.github.com/users/HoangHai2401/gists{/gist_id}","starred_url":"https://api.github.com/users/HoangHai2401/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoangHai2401/subscriptions","organizations_url":"https://api.github.com/users/HoangHai2401/orgs","repos_url":"https://api.github.com/users/HoangHai2401/repos","events_url":"https://api.github.com/users/HoangHai2401/events{/privacy}","received_events_url":"https://api.github.com/users/HoangHai2401/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HoangHai2401/IOS_MovieDB_02","description":null,"fork":true,"url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02","forks_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/forks","keys_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/teams","hooks_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/hooks","issue_events_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/issues/events{/number}","events_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/events","assignees_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/assignees{/user}","branches_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/branches{/branch}","tags_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/tags","blobs_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/statuses/{sha}","languages_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/languages","stargazers_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/stargazers","contributors_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/contributors","subscribers_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/subscribers","subscription_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/subscription","commits_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/contents/{+path}","compare_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/merges","archive_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/downloads","issues_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/issues{/number}","pulls_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/pulls{/number}","milestones_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/milestones{/number}","notifications_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/labels{/name}","releases_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/releases{/id}","deployments_url":"https://api.github.com/repos/HoangHai2401/IOS_MovieDB_02/deployments","created_at":"2018-07-23T09:37:39Z","updated_at":"2018-07-23T09:37:41Z","pushed_at":"2018-08-01T03:17:57Z","git_url":"git://github.com/HoangHai2401/IOS_MovieDB_02.git","ssh_url":"git@github.com:HoangHai2401/IOS_MovieDB_02.git","clone_url":"https://github.com/HoangHai2401/IOS_MovieDB_02.git","svn_url":"https://github.com/HoangHai2401/IOS_MovieDB_02","homepage":null,"size":156,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"70306ef6bb370ffbf28aeceaeef905c3512fdb45","user":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":141695090,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE2OTUwOTA=","name":"IOS_MovieDB_02","full_name":"framgia/IOS_MovieDB_02","owner":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/IOS_MovieDB_02","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/IOS_MovieDB_02","forks_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/forks","keys_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/teams","hooks_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/hooks","issue_events_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/events","assignees_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/tags","blobs_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/languages","stargazers_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/stargazers","contributors_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/contributors","subscribers_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/subscribers","subscription_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/subscription","commits_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/merges","archive_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/downloads","issues_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/labels{/name}","releases_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/IOS_MovieDB_02/deployments","created_at":"2018-07-20T09:52:32Z","updated_at":"2018-08-01T01:12:39Z","pushed_at":"2018-08-01T03:19:38Z","git_url":"git://github.com/framgia/IOS_MovieDB_02.git","ssh_url":"git@github.com:framgia/IOS_MovieDB_02.git","clone_url":"https://github.com/framgia/IOS_MovieDB_02.git","svn_url":"https://github.com/framgia/IOS_MovieDB_02","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13"},"html":{"href":"https://github.com/framgia/IOS_MovieDB_02/pull/13"},"issue":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/13"},"comments":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/IOS_MovieDB_02/statuses/d9742a0afe62c7d91e168006e0d6aca3b94b83b2"}},"author_association":"NONE"}}
{"actor":{"display_login":"framgia-nguyenkdm"}}