{"action":"created","comment":{"url":"https://api.github.com/repos/vazco/uniforms/pulls/comments/203610722","pull_request_review_id":138532841,"id":203610722,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzYxMDcyMg==","diff_hunk":"@@ -238,10 +247,30 @@ export default class BaseForm extends Component {\n             event.stopPropagation();\n         }\n \n-        return Promise.resolve(\n-            this.props.onSubmit &&\n-            this.props.onSubmit(this.getModel('submit'))\n-        ).then(\n+        let submitting;\n+        try {\n+            const res = this.props.onSubmit && this.props.onSubmit(this.getModel('submit'));\n+            submitting = Promise.resolve(res);\n+\n+            // Do not change the `submitting` state if onSubmit is not async\n+            if (res && isFunction(res.then)) {\n+                this.setState({submitting: true});\n+                submitting = submitting.then(\n+                    val => {\n+                        this.setState({submitting: false});\n+                        return val;\n+                    },\n+                    err => {\n+                        this.setState({submitting: false});\n+                        throw err;\n+                    }\n+                );\n+            }\n+        } catch (error) {\n+            submitting = Promise.reject(error);\n+        }\n+\n+        return submitting.then(","path":"packages/uniforms/src/BaseForm.js","position":null,"original_position":92,"commit_id":"5bfc0604300b3d8c4b0962ad3588874ffb1d83ce","original_commit_id":"bed378d2dcb5f5fd3f6c3dcf68b7cc720eb09bb5","user":{"login":"BudgieInWA","id":3784591,"node_id":"MDQ6VXNlcjM3ODQ1OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/3784591?v=4","gravatar_id":"","url":"https://api.github.com/users/BudgieInWA","html_url":"https://github.com/BudgieInWA","followers_url":"https://api.github.com/users/BudgieInWA/followers","following_url":"https://api.github.com/users/BudgieInWA/following{/other_user}","gists_url":"https://api.github.com/users/BudgieInWA/gists{/gist_id}","starred_url":"https://api.github.com/users/BudgieInWA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BudgieInWA/subscriptions","organizations_url":"https://api.github.com/users/BudgieInWA/orgs","repos_url":"https://api.github.com/users/BudgieInWA/repos","events_url":"https://api.github.com/users/BudgieInWA/events{/privacy}","received_events_url":"https://api.github.com/users/BudgieInWA/received_events","type":"User","site_admin":false},"body":"- That is sensible. I have removed the try/catch.","created_at":"2018-07-19T06:07:54Z","updated_at":"2018-07-19T06:07:55Z","html_url":"https://github.com/vazco/uniforms/pull/449#discussion_r203610722","pull_request_url":"https://api.github.com/repos/vazco/uniforms/pulls/449","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/comments/203610722"},"html":{"href":"https://github.com/vazco/uniforms/pull/449#discussion_r203610722"},"pull_request":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/449"}},"in_reply_to_id":203129650},"pull_request":{"url":"https://api.github.com/repos/vazco/uniforms/pulls/449","id":201841694,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxODQxNjk0","html_url":"https://github.com/vazco/uniforms/pull/449","diff_url":"https://github.com/vazco/uniforms/pull/449.diff","patch_url":"https://github.com/vazco/uniforms/pull/449.patch","issue_url":"https://api.github.com/repos/vazco/uniforms/issues/449","number":449,"state":"open","locked":false,"title":"Add `submitting` state property that is `true` while `onSubmit` is pending","user":{"login":"BudgieInWA","id":3784591,"node_id":"MDQ6VXNlcjM3ODQ1OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/3784591?v=4","gravatar_id":"","url":"https://api.github.com/users/BudgieInWA","html_url":"https://github.com/BudgieInWA","followers_url":"https://api.github.com/users/BudgieInWA/followers","following_url":"https://api.github.com/users/BudgieInWA/following{/other_user}","gists_url":"https://api.github.com/users/BudgieInWA/gists{/gist_id}","starred_url":"https://api.github.com/users/BudgieInWA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BudgieInWA/subscriptions","organizations_url":"https://api.github.com/users/BudgieInWA/orgs","repos_url":"https://api.github.com/users/BudgieInWA/repos","events_url":"https://api.github.com/users/BudgieInWA/events{/privacy}","received_events_url":"https://api.github.com/users/BudgieInWA/received_events","type":"User","site_admin":false},"body":"This PR (eventually) Implements #441.\r\n\r\nThis is my attempt to implement the feature tracked in #441 in uniforms core. I am looking forward to feedback, and if it turns out that this solutions would be acceptable, I can implement `validating` similarly.\r\n\r\nThe commit messages provide motivation for the individual changes.","created_at":"2018-07-17T06:59:26Z","updated_at":"2018-07-19T06:07:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef664b54d799239062158025d16afa86cd050c6f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":373826914,"node_id":"MDU6TGFiZWwzNzM4MjY5MTQ=","url":"https://api.github.com/repos/vazco/uniforms/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/vazco/uniforms/pulls/449/commits","review_comments_url":"https://api.github.com/repos/vazco/uniforms/pulls/449/comments","review_comment_url":"https://api.github.com/repos/vazco/uniforms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vazco/uniforms/issues/449/comments","statuses_url":"https://api.github.com/repos/vazco/uniforms/statuses/5bfc0604300b3d8c4b0962ad3588874ffb1d83ce","head":{"label":"BudgieInWA:submitting-state-1","ref":"submitting-state-1","sha":"5bfc0604300b3d8c4b0962ad3588874ffb1d83ce","user":{"login":"BudgieInWA","id":3784591,"node_id":"MDQ6VXNlcjM3ODQ1OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/3784591?v=4","gravatar_id":"","url":"https://api.github.com/users/BudgieInWA","html_url":"https://github.com/BudgieInWA","followers_url":"https://api.github.com/users/BudgieInWA/followers","following_url":"https://api.github.com/users/BudgieInWA/following{/other_user}","gists_url":"https://api.github.com/users/BudgieInWA/gists{/gist_id}","starred_url":"https://api.github.com/users/BudgieInWA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BudgieInWA/subscriptions","organizations_url":"https://api.github.com/users/BudgieInWA/orgs","repos_url":"https://api.github.com/users/BudgieInWA/repos","events_url":"https://api.github.com/users/BudgieInWA/events{/privacy}","received_events_url":"https://api.github.com/users/BudgieInWA/received_events","type":"User","site_admin":false},"repo":{"id":139114759,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxMTQ3NTk=","name":"uniforms","full_name":"BudgieInWA/uniforms","owner":{"login":"BudgieInWA","id":3784591,"node_id":"MDQ6VXNlcjM3ODQ1OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/3784591?v=4","gravatar_id":"","url":"https://api.github.com/users/BudgieInWA","html_url":"https://github.com/BudgieInWA","followers_url":"https://api.github.com/users/BudgieInWA/followers","following_url":"https://api.github.com/users/BudgieInWA/following{/other_user}","gists_url":"https://api.github.com/users/BudgieInWA/gists{/gist_id}","starred_url":"https://api.github.com/users/BudgieInWA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BudgieInWA/subscriptions","organizations_url":"https://api.github.com/users/BudgieInWA/orgs","repos_url":"https://api.github.com/users/BudgieInWA/repos","events_url":"https://api.github.com/users/BudgieInWA/events{/privacy}","received_events_url":"https://api.github.com/users/BudgieInWA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BudgieInWA/uniforms","description":"Bunch of React components and helpers to easily generate and validate forms.","fork":true,"url":"https://api.github.com/repos/BudgieInWA/uniforms","forks_url":"https://api.github.com/repos/BudgieInWA/uniforms/forks","keys_url":"https://api.github.com/repos/BudgieInWA/uniforms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BudgieInWA/uniforms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BudgieInWA/uniforms/teams","hooks_url":"https://api.github.com/repos/BudgieInWA/uniforms/hooks","issue_events_url":"https://api.github.com/repos/BudgieInWA/uniforms/issues/events{/number}","events_url":"https://api.github.com/repos/BudgieInWA/uniforms/events","assignees_url":"https://api.github.com/repos/BudgieInWA/uniforms/assignees{/user}","branches_url":"https://api.github.com/repos/BudgieInWA/uniforms/branches{/branch}","tags_url":"https://api.github.com/repos/BudgieInWA/uniforms/tags","blobs_url":"https://api.github.com/repos/BudgieInWA/uniforms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BudgieInWA/uniforms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BudgieInWA/uniforms/git/refs{/sha}","trees_url":"https://api.github.com/repos/BudgieInWA/uniforms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BudgieInWA/uniforms/statuses/{sha}","languages_url":"https://api.github.com/repos/BudgieInWA/uniforms/languages","stargazers_url":"https://api.github.com/repos/BudgieInWA/uniforms/stargazers","contributors_url":"https://api.github.com/repos/BudgieInWA/uniforms/contributors","subscribers_url":"https://api.github.com/repos/BudgieInWA/uniforms/subscribers","subscription_url":"https://api.github.com/repos/BudgieInWA/uniforms/subscription","commits_url":"https://api.github.com/repos/BudgieInWA/uniforms/commits{/sha}","git_commits_url":"https://api.github.com/repos/BudgieInWA/uniforms/git/commits{/sha}","comments_url":"https://api.github.com/repos/BudgieInWA/uniforms/comments{/number}","issue_comment_url":"https://api.github.com/repos/BudgieInWA/uniforms/issues/comments{/number}","contents_url":"https://api.github.com/repos/BudgieInWA/uniforms/contents/{+path}","compare_url":"https://api.github.com/repos/BudgieInWA/uniforms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BudgieInWA/uniforms/merges","archive_url":"https://api.github.com/repos/BudgieInWA/uniforms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BudgieInWA/uniforms/downloads","issues_url":"https://api.github.com/repos/BudgieInWA/uniforms/issues{/number}","pulls_url":"https://api.github.com/repos/BudgieInWA/uniforms/pulls{/number}","milestones_url":"https://api.github.com/repos/BudgieInWA/uniforms/milestones{/number}","notifications_url":"https://api.github.com/repos/BudgieInWA/uniforms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BudgieInWA/uniforms/labels{/name}","releases_url":"https://api.github.com/repos/BudgieInWA/uniforms/releases{/id}","deployments_url":"https://api.github.com/repos/BudgieInWA/uniforms/deployments","created_at":"2018-06-29T07:14:54Z","updated_at":"2018-06-29T07:14:56Z","pushed_at":"2018-07-19T06:01:12Z","git_url":"git://github.com/BudgieInWA/uniforms.git","ssh_url":"git@github.com:BudgieInWA/uniforms.git","clone_url":"https://github.com/BudgieInWA/uniforms.git","svn_url":"https://github.com/BudgieInWA/uniforms","homepage":"","size":2418,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vazco:master","ref":"master","sha":"fe15cd15f633bcd6bea51681199c6da6cd5fe7d4","user":{"login":"vazco","id":1339616,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzk2MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1339616?v=4","gravatar_id":"","url":"https://api.github.com/users/vazco","html_url":"https://github.com/vazco","followers_url":"https://api.github.com/users/vazco/followers","following_url":"https://api.github.com/users/vazco/following{/other_user}","gists_url":"https://api.github.com/users/vazco/gists{/gist_id}","starred_url":"https://api.github.com/users/vazco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vazco/subscriptions","organizations_url":"https://api.github.com/users/vazco/orgs","repos_url":"https://api.github.com/users/vazco/repos","events_url":"https://api.github.com/users/vazco/events{/privacy}","received_events_url":"https://api.github.com/users/vazco/received_events","type":"Organization","site_admin":false},"repo":{"id":58462216,"node_id":"MDEwOlJlcG9zaXRvcnk1ODQ2MjIxNg==","name":"uniforms","full_name":"vazco/uniforms","owner":{"login":"vazco","id":1339616,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzk2MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1339616?v=4","gravatar_id":"","url":"https://api.github.com/users/vazco","html_url":"https://github.com/vazco","followers_url":"https://api.github.com/users/vazco/followers","following_url":"https://api.github.com/users/vazco/following{/other_user}","gists_url":"https://api.github.com/users/vazco/gists{/gist_id}","starred_url":"https://api.github.com/users/vazco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vazco/subscriptions","organizations_url":"https://api.github.com/users/vazco/orgs","repos_url":"https://api.github.com/users/vazco/repos","events_url":"https://api.github.com/users/vazco/events{/privacy}","received_events_url":"https://api.github.com/users/vazco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vazco/uniforms","description":"Bunch of React components and helpers to easily generate and validate forms.","fork":false,"url":"https://api.github.com/repos/vazco/uniforms","forks_url":"https://api.github.com/repos/vazco/uniforms/forks","keys_url":"https://api.github.com/repos/vazco/uniforms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vazco/uniforms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vazco/uniforms/teams","hooks_url":"https://api.github.com/repos/vazco/uniforms/hooks","issue_events_url":"https://api.github.com/repos/vazco/uniforms/issues/events{/number}","events_url":"https://api.github.com/repos/vazco/uniforms/events","assignees_url":"https://api.github.com/repos/vazco/uniforms/assignees{/user}","branches_url":"https://api.github.com/repos/vazco/uniforms/branches{/branch}","tags_url":"https://api.github.com/repos/vazco/uniforms/tags","blobs_url":"https://api.github.com/repos/vazco/uniforms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vazco/uniforms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vazco/uniforms/git/refs{/sha}","trees_url":"https://api.github.com/repos/vazco/uniforms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vazco/uniforms/statuses/{sha}","languages_url":"https://api.github.com/repos/vazco/uniforms/languages","stargazers_url":"https://api.github.com/repos/vazco/uniforms/stargazers","contributors_url":"https://api.github.com/repos/vazco/uniforms/contributors","subscribers_url":"https://api.github.com/repos/vazco/uniforms/subscribers","subscription_url":"https://api.github.com/repos/vazco/uniforms/subscription","commits_url":"https://api.github.com/repos/vazco/uniforms/commits{/sha}","git_commits_url":"https://api.github.com/repos/vazco/uniforms/git/commits{/sha}","comments_url":"https://api.github.com/repos/vazco/uniforms/comments{/number}","issue_comment_url":"https://api.github.com/repos/vazco/uniforms/issues/comments{/number}","contents_url":"https://api.github.com/repos/vazco/uniforms/contents/{+path}","compare_url":"https://api.github.com/repos/vazco/uniforms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vazco/uniforms/merges","archive_url":"https://api.github.com/repos/vazco/uniforms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vazco/uniforms/downloads","issues_url":"https://api.github.com/repos/vazco/uniforms/issues{/number}","pulls_url":"https://api.github.com/repos/vazco/uniforms/pulls{/number}","milestones_url":"https://api.github.com/repos/vazco/uniforms/milestones{/number}","notifications_url":"https://api.github.com/repos/vazco/uniforms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vazco/uniforms/labels{/name}","releases_url":"https://api.github.com/repos/vazco/uniforms/releases{/id}","deployments_url":"https://api.github.com/repos/vazco/uniforms/deployments","created_at":"2016-05-10T13:08:50Z","updated_at":"2018-07-18T21:52:22Z","pushed_at":"2018-07-19T06:01:14Z","git_url":"git://github.com/vazco/uniforms.git","ssh_url":"git@github.com:vazco/uniforms.git","clone_url":"https://github.com/vazco/uniforms.git","svn_url":"https://github.com/vazco/uniforms","homepage":"","size":2403,"stargazers_count":530,"watchers_count":530,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":86,"open_issues":9,"watchers":530,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/449"},"html":{"href":"https://github.com/vazco/uniforms/pull/449"},"issue":{"href":"https://api.github.com/repos/vazco/uniforms/issues/449"},"comments":{"href":"https://api.github.com/repos/vazco/uniforms/issues/449/comments"},"review_comments":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/449/comments"},"review_comment":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vazco/uniforms/pulls/449/commits"},"statuses":{"href":"https://api.github.com/repos/vazco/uniforms/statuses/5bfc0604300b3d8c4b0962ad3588874ffb1d83ce"}},"author_association":"NONE"}}
{"actor":{"display_login":"BudgieInWA"}}