{"action":"created","comment":{"url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/comments/50618155","id":50618155,"diff_hunk":"@@ -1,27 +1,48 @@\n import UIKit\n \n-public enum TextUpdater {\n+protocol ViewModel {\n+    typealias Services\n+    typealias Presenters\n     \n-    struct ViewModelPresenter {\n+    static func ViewModel(services: Services, _ presenters: Presenters);\n+}\n+\n+extension ViewModel {\n+    typealias UnpresentedViewModel = Presenters -> ()\n+    static func ViewModel(services: Services)(presenters: Presenters) {\n+        ViewModel(services, presenters)\n+    }\n+}\n+\n+enum TextUpdater : ViewModel {\n+    struct Services {\n+        let reversText: String -> String\n+    }\n+    \n+    struct Presenters {\n         let text: Presenter<String>\n-        let input: Presenter<String -> ()>\n+        let textUpdate: Presenter<String -> ()>\n     }\n     \n-    @objc(TextUpdaterViewController)\n-    public class ViewController: UIViewController {\n-        \n-        @IBOutlet weak var label: UILabel!\n-        @IBOutlet weak var textField: UITextField!\n+    static func ViewModel(services: Services, _ presenters: Presenters) {\n+        presenters.text.present(\"\")\n         \n-        var viewModel: ((() -> ViewModelPresenter) -> ())?\n-        \n-        override public func viewDidLoad() {\n-            super.viewDidLoad()\n-            \n-            viewModel! {[unowned self] in\n-                return ViewModelPresenter(\n-                    text: self.label.textPresenter,\n-                    input:  self.textField.textSinkPresenter) }\n+        presenters.textUpdate.present { newText in\n+            presenters.text.present(services.reversText(newText))\n         }\n     }\n+}\n+\n+class TextUpdaterViewController: UIViewController {\n+    @IBOutlet weak var label: UILabel!\n+    @IBOutlet weak var textField: UITextField!\n+    \n+    var viewModel: TextUpdater.UnpresentedViewModel?\n+    \n+    override func viewDidLoad() {\n+        viewModel?(TextUpdater.Presenters(","path":"test/TextUpdater.swift","position":60,"original_position":60,"commit_id":"c284443aacddc2be05cbc75c82395a5bc703554c","original_commit_id":"c284443aacddc2be05cbc75c82395a5bc703554c","user":{"login":"AlexeyDemedetskiy","id":585375,"avatar_url":"https://avatars.githubusercontent.com/u/585375?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexeyDemedetskiy","html_url":"https://github.com/AlexeyDemedetskiy","followers_url":"https://api.github.com/users/AlexeyDemedetskiy/followers","following_url":"https://api.github.com/users/AlexeyDemedetskiy/following{/other_user}","gists_url":"https://api.github.com/users/AlexeyDemedetskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexeyDemedetskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexeyDemedetskiy/subscriptions","organizations_url":"https://api.github.com/users/AlexeyDemedetskiy/orgs","repos_url":"https://api.github.com/users/AlexeyDemedetskiy/repos","events_url":"https://api.github.com/users/AlexeyDemedetskiy/events{/privacy}","received_events_url":"https://api.github.com/users/AlexeyDemedetskiy/received_events","type":"User","site_admin":false},"body":"It is not presented during whole VC lifecycle. ","created_at":"2016-01-23T09:12:28Z","updated_at":"2016-01-23T09:12:28Z","html_url":"https://github.com/xNekOIx/FuntionalMVP/pull/1#discussion_r50618155","pull_request_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/comments/50618155"},"html":{"href":"https://github.com/xNekOIx/FuntionalMVP/pull/1#discussion_r50618155"},"pull_request":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1","id":56955283,"html_url":"https://github.com/xNekOIx/FuntionalMVP/pull/1","diff_url":"https://github.com/xNekOIx/FuntionalMVP/pull/1.diff","patch_url":"https://github.com/xNekOIx/FuntionalMVP/pull/1.patch","issue_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/1","number":1,"state":"open","locked":false,"title":"Another version of FMVP imply.","user":{"login":"AlexeyDemedetskiy","id":585375,"avatar_url":"https://avatars.githubusercontent.com/u/585375?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexeyDemedetskiy","html_url":"https://github.com/AlexeyDemedetskiy","followers_url":"https://api.github.com/users/AlexeyDemedetskiy/followers","following_url":"https://api.github.com/users/AlexeyDemedetskiy/following{/other_user}","gists_url":"https://api.github.com/users/AlexeyDemedetskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexeyDemedetskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexeyDemedetskiy/subscriptions","organizations_url":"https://api.github.com/users/AlexeyDemedetskiy/orgs","repos_url":"https://api.github.com/users/AlexeyDemedetskiy/repos","events_url":"https://api.github.com/users/AlexeyDemedetskiy/events{/privacy}","received_events_url":"https://api.github.com/users/AlexeyDemedetskiy/received_events","type":"User","site_admin":false},"body":"This is simplified vision of FVMP.\r\n\r\nNote, that there is no Disposable support, \r\nbut general code layout should be clear to you.","created_at":"2016-01-22T23:19:44Z","updated_at":"2016-01-23T09:12:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6656fb8c4ea0d35b07ad8b8f75c118caa3a8515d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1/commits","review_comments_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1/comments","review_comment_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/1/comments","statuses_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/statuses/c284443aacddc2be05cbc75c82395a5bc703554c","head":{"label":"AlexeyDemedetskiy:master","ref":"master","sha":"c284443aacddc2be05cbc75c82395a5bc703554c","user":{"login":"AlexeyDemedetskiy","id":585375,"avatar_url":"https://avatars.githubusercontent.com/u/585375?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexeyDemedetskiy","html_url":"https://github.com/AlexeyDemedetskiy","followers_url":"https://api.github.com/users/AlexeyDemedetskiy/followers","following_url":"https://api.github.com/users/AlexeyDemedetskiy/following{/other_user}","gists_url":"https://api.github.com/users/AlexeyDemedetskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexeyDemedetskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexeyDemedetskiy/subscriptions","organizations_url":"https://api.github.com/users/AlexeyDemedetskiy/orgs","repos_url":"https://api.github.com/users/AlexeyDemedetskiy/repos","events_url":"https://api.github.com/users/AlexeyDemedetskiy/events{/privacy}","received_events_url":"https://api.github.com/users/AlexeyDemedetskiy/received_events","type":"User","site_admin":false},"repo":{"id":50213402,"name":"FuntionalMVP","full_name":"AlexeyDemedetskiy/FuntionalMVP","owner":{"login":"AlexeyDemedetskiy","id":585375,"avatar_url":"https://avatars.githubusercontent.com/u/585375?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexeyDemedetskiy","html_url":"https://github.com/AlexeyDemedetskiy","followers_url":"https://api.github.com/users/AlexeyDemedetskiy/followers","following_url":"https://api.github.com/users/AlexeyDemedetskiy/following{/other_user}","gists_url":"https://api.github.com/users/AlexeyDemedetskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexeyDemedetskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexeyDemedetskiy/subscriptions","organizations_url":"https://api.github.com/users/AlexeyDemedetskiy/orgs","repos_url":"https://api.github.com/users/AlexeyDemedetskiy/repos","events_url":"https://api.github.com/users/AlexeyDemedetskiy/events{/privacy}","received_events_url":"https://api.github.com/users/AlexeyDemedetskiy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexeyDemedetskiy/FuntionalMVP","description":"","fork":true,"url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP","forks_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/forks","keys_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/teams","hooks_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/hooks","issue_events_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/issues/events{/number}","events_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/events","assignees_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/assignees{/user}","branches_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/branches{/branch}","tags_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/tags","blobs_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/languages","stargazers_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/stargazers","contributors_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/contributors","subscribers_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/subscribers","subscription_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/subscription","commits_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/contents/{+path}","compare_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/merges","archive_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/downloads","issues_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/issues{/number}","pulls_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/labels{/name}","releases_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/releases{/id}","deployments_url":"https://api.github.com/repos/AlexeyDemedetskiy/FuntionalMVP/deployments","created_at":"2016-01-22T23:14:44Z","updated_at":"2016-01-22T23:14:45Z","pushed_at":"2016-01-22T23:37:00Z","git_url":"git://github.com/AlexeyDemedetskiy/FuntionalMVP.git","ssh_url":"git@github.com:AlexeyDemedetskiy/FuntionalMVP.git","clone_url":"https://github.com/AlexeyDemedetskiy/FuntionalMVP.git","svn_url":"https://github.com/AlexeyDemedetskiy/FuntionalMVP","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xNekOIx:master","ref":"master","sha":"77d07eaccc1186d3fac066592f61d1738245b636","user":{"login":"xNekOIx","id":1261471,"avatar_url":"https://avatars.githubusercontent.com/u/1261471?v=3","gravatar_id":"","url":"https://api.github.com/users/xNekOIx","html_url":"https://github.com/xNekOIx","followers_url":"https://api.github.com/users/xNekOIx/followers","following_url":"https://api.github.com/users/xNekOIx/following{/other_user}","gists_url":"https://api.github.com/users/xNekOIx/gists{/gist_id}","starred_url":"https://api.github.com/users/xNekOIx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xNekOIx/subscriptions","organizations_url":"https://api.github.com/users/xNekOIx/orgs","repos_url":"https://api.github.com/users/xNekOIx/repos","events_url":"https://api.github.com/users/xNekOIx/events{/privacy}","received_events_url":"https://api.github.com/users/xNekOIx/received_events","type":"User","site_admin":false},"repo":{"id":50196382,"name":"FuntionalMVP","full_name":"xNekOIx/FuntionalMVP","owner":{"login":"xNekOIx","id":1261471,"avatar_url":"https://avatars.githubusercontent.com/u/1261471?v=3","gravatar_id":"","url":"https://api.github.com/users/xNekOIx","html_url":"https://github.com/xNekOIx","followers_url":"https://api.github.com/users/xNekOIx/followers","following_url":"https://api.github.com/users/xNekOIx/following{/other_user}","gists_url":"https://api.github.com/users/xNekOIx/gists{/gist_id}","starred_url":"https://api.github.com/users/xNekOIx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xNekOIx/subscriptions","organizations_url":"https://api.github.com/users/xNekOIx/orgs","repos_url":"https://api.github.com/users/xNekOIx/repos","events_url":"https://api.github.com/users/xNekOIx/events{/privacy}","received_events_url":"https://api.github.com/users/xNekOIx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xNekOIx/FuntionalMVP","description":"","fork":false,"url":"https://api.github.com/repos/xNekOIx/FuntionalMVP","forks_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/forks","keys_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/teams","hooks_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/hooks","issue_events_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/events{/number}","events_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/events","assignees_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/assignees{/user}","branches_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/branches{/branch}","tags_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/tags","blobs_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/git/refs{/sha}","trees_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/statuses/{sha}","languages_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/languages","stargazers_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/stargazers","contributors_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/contributors","subscribers_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/subscribers","subscription_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/subscription","commits_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/commits{/sha}","git_commits_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/git/commits{/sha}","comments_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/comments{/number}","issue_comment_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/comments{/number}","contents_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/contents/{+path}","compare_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/merges","archive_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/downloads","issues_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues{/number}","pulls_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls{/number}","milestones_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/milestones{/number}","notifications_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/labels{/name}","releases_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/releases{/id}","deployments_url":"https://api.github.com/repos/xNekOIx/FuntionalMVP/deployments","created_at":"2016-01-22T17:27:28Z","updated_at":"2016-01-22T17:30:57Z","pushed_at":"2016-01-22T23:37:01Z","git_url":"git://github.com/xNekOIx/FuntionalMVP.git","ssh_url":"git@github.com:xNekOIx/FuntionalMVP.git","clone_url":"https://github.com/xNekOIx/FuntionalMVP.git","svn_url":"https://github.com/xNekOIx/FuntionalMVP","homepage":null,"size":9,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1"},"html":{"href":"https://github.com/xNekOIx/FuntionalMVP/pull/1"},"issue":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/1"},"comments":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/xNekOIx/FuntionalMVP/statuses/c284443aacddc2be05cbc75c82395a5bc703554c"}}}}