{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/comments/80372618","id":80372618,"diff_hunk":"@@ -31,34 +31,12 @@ public final class Action<Input, Output, Error: Swift.Error> {\n \tpublic let errors: Signal<Error, NoError>\n \n \t/// Whether the action is currently executing.\n-\tpublic var isExecuting: Property<Bool> {\n-\t\treturn Property(_isExecuting)\n-\t}\n-\n-\tprivate let _isExecuting: MutableProperty<Bool> = MutableProperty(false)\n+\tpublic let isExecuting: Property<Bool>\n \n \t/// Whether the action is currently enabled.\n-\tpublic var isEnabled: Property<Bool> {\n-\t\treturn Property(_isEnabled)\n-\t}\n-\n-\tprivate let _isEnabled: MutableProperty<Bool> = MutableProperty(false)\n-\n-\t/// Whether the instantiator of this action wants it to be enabled.\n-\tprivate let isUserEnabled: Property<Bool>\n+\tpublic let isEnabled: Property<Bool>\n \n-\t/// This queue is used for read-modify-write operations on the `_executing`\n-\t/// property.\n-\tprivate let executingQueue = DispatchQueue(\n-\t\tlabel: \"org.reactivecocoa.ReactiveSwift.Action.executingQueue\",\n-\t\tattributes: []\n-\t)\n-\n-\t/// Whether the action should be enabled for the given combination of user\n-\t/// enabledness and executing status.\n-\tprivate static func shouldBeEnabled(userEnabled: Bool, executing: Bool) -> Bool {\n-\t\treturn userEnabled && !executing\n-\t}\n+\tprivate let _state: MutableProperty<ActionState>","path":"Sources/Action.swift","position":34,"original_position":34,"commit_id":"25a302438f94b121258d1dd05ddf4e2f7de9a2c8","original_commit_id":"25a302438f94b121258d1dd05ddf4e2f7de9a2c8","user":{"login":"mdiep","id":1302,"avatar_url":"https://avatars.githubusercontent.com/u/1302?v=3","gravatar_id":"","url":"https://api.github.com/users/mdiep","html_url":"https://github.com/mdiep","followers_url":"https://api.github.com/users/mdiep/followers","following_url":"https://api.github.com/users/mdiep/following{/other_user}","gists_url":"https://api.github.com/users/mdiep/gists{/gist_id}","starred_url":"https://api.github.com/users/mdiep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdiep/subscriptions","organizations_url":"https://api.github.com/users/mdiep/orgs","repos_url":"https://api.github.com/users/mdiep/repos","events_url":"https://api.github.com/users/mdiep/events{/privacy}","received_events_url":"https://api.github.com/users/mdiep/received_events","type":"User","site_admin":false},"body":"Our style has been to not prefix private variables with an underscore unless there's a public variable with the same name.","created_at":"2016-09-25T02:11:44Z","updated_at":"2016-09-25T02:26:36Z","html_url":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22#discussion_r80372618","pull_request_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/comments/80372618"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22#discussion_r80372618"},"pull_request":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22","id":85843790,"html_url":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22","diff_url":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22.diff","patch_url":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22.patch","issue_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/22","number":22,"state":"open","locked":false,"title":"Add initialisers to create an Action from an input property","user":{"login":"sharplet","id":147686,"avatar_url":"https://avatars.githubusercontent.com/u/147686?v=3","gravatar_id":"","url":"https://api.github.com/users/sharplet","html_url":"https://github.com/sharplet","followers_url":"https://api.github.com/users/sharplet/followers","following_url":"https://api.github.com/users/sharplet/following{/other_user}","gists_url":"https://api.github.com/users/sharplet/gists{/gist_id}","starred_url":"https://api.github.com/users/sharplet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharplet/subscriptions","organizations_url":"https://api.github.com/users/sharplet/orgs","repos_url":"https://api.github.com/users/sharplet/repos","events_url":"https://api.github.com/users/sharplet/events{/privacy}","received_events_url":"https://api.github.com/users/sharplet/received_events","type":"User","site_admin":false},"body":"`PropertyAction` encapsulates the pattern where an `Action` should be enabled only if its input is non-nil.\r\n\r\nThe prime example of this pattern is form validation: validate some input text, and store the validated results in a property. If the form is valid, the property will be non-nil, and it should be safe to grab the current value and submit the form.\r\n\r\nI've personally written a bunch of `Action`-based code that basically just implemented this logic in an ad-hoc fashion, so I think it would be super useful to have a convenient shorthand for it.\r\n\r\n---\r\n\r\nIdeally this could just be a convenience initialiser on `Action`:\r\n\r\n    extension Action where Input == Void {\r\n      // ...\r\n    }\r\n\r\nBut unfortunately this triggers Swift's \"same-type requirement makes generic parameter non-generic\" error.","created_at":"2016-09-19T18:22:17Z","updated_at":"2016-09-25T02:26:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fa9506370cada7c2f171a98d06ae8c246ea34d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22/commits","review_comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22/comments","review_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/22/comments","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/statuses/25a302438f94b121258d1dd05ddf4e2f7de9a2c8","head":{"label":"ReactiveCocoa:as-action-input-property","ref":"as-action-input-property","sha":"25a302438f94b121258d1dd05ddf4e2f7de9a2c8","user":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"repo":{"id":59369770,"name":"ReactiveSwift","full_name":"ReactiveCocoa/ReactiveSwift","owner":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveCocoa/ReactiveSwift","description":"Streams of values over time","fork":false,"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift","forks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/forks","keys_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/teams","hooks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/hooks","issue_events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/events","assignees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/tags","blobs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/languages","stargazers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/stargazers","contributors_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/contributors","subscribers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/subscribers","subscription_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/subscription","commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/merges","archive_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/downloads","issues_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/releases{/id}","deployments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/deployments","created_at":"2016-05-21T16:20:03Z","updated_at":"2016-09-24T20:35:26Z","pushed_at":"2016-09-25T00:43:28Z","git_url":"git://github.com/ReactiveCocoa/ReactiveSwift.git","ssh_url":"git@github.com:ReactiveCocoa/ReactiveSwift.git","clone_url":"https://github.com/ReactiveCocoa/ReactiveSwift.git","svn_url":"https://github.com/ReactiveCocoa/ReactiveSwift","homepage":null,"size":14934,"stargazers_count":329,"watchers_count":329,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":9,"forks":15,"open_issues":9,"watchers":329,"default_branch":"master"}},"base":{"label":"ReactiveCocoa:master","ref":"master","sha":"1dc7eb74f7c807fe0c85c9cd2130acedbc5f1765","user":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"repo":{"id":59369770,"name":"ReactiveSwift","full_name":"ReactiveCocoa/ReactiveSwift","owner":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveCocoa/ReactiveSwift","description":"Streams of values over time","fork":false,"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift","forks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/forks","keys_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/teams","hooks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/hooks","issue_events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/events","assignees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/tags","blobs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/languages","stargazers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/stargazers","contributors_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/contributors","subscribers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/subscribers","subscription_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/subscription","commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/merges","archive_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/downloads","issues_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/releases{/id}","deployments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/deployments","created_at":"2016-05-21T16:20:03Z","updated_at":"2016-09-24T20:35:26Z","pushed_at":"2016-09-25T00:43:28Z","git_url":"git://github.com/ReactiveCocoa/ReactiveSwift.git","ssh_url":"git@github.com:ReactiveCocoa/ReactiveSwift.git","clone_url":"https://github.com/ReactiveCocoa/ReactiveSwift.git","svn_url":"https://github.com/ReactiveCocoa/ReactiveSwift","homepage":null,"size":14934,"stargazers_count":329,"watchers_count":329,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":9,"forks":15,"open_issues":9,"watchers":329,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveSwift/pull/22"},"issue":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/22"},"comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveSwift/statuses/25a302438f94b121258d1dd05ddf4e2f7de9a2c8"}}}}
{"actor":{"display_login":"mdiep"}}