{"action":"created","comment":{"url":"https://api.github.com/repos/behance/BeFF/pulls/comments/32349874","id":32349874,"diff_hunk":"@@ -345,5 +359,56 @@ define([\n         xhr: xhr\n       });\n     }\n+  }, {\n+    promise: function(options) {\n+      var Uploader = this;\n+      return new Promise(function(resolve, reject) {\n+        var uploader = Uploader.init(options),\n+            submittedCount = 0,\n+            fileMap = {},\n+            fileList;\n+\n+        function resolveCheck() {\n+          submittedCount++;\n+          if (submittedCount === fileList.length) {\n+            resolve(fileList);\n+          }\n+        }\n+\n+        uploader\n+        .on('validateBatch', function(data) {\n+          fileList = data.files.map(function(file) {\n+            fileMap[file.name] = {\n+              file: null,\n+              promise: extend(new Promise(), pubsub)","path":"Component/CloudUploader.js","position":88,"original_position":88,"commit_id":"450931663b3350c0fa05cc999a17b1ed72f40f4b","original_commit_id":"450931663b3350c0fa05cc999a17b1ed72f40f4b","user":{"login":"mikesherov","id":364532,"avatar_url":"https://avatars.githubusercontent.com/u/364532?v=3","gravatar_id":"","url":"https://api.github.com/users/mikesherov","html_url":"https://github.com/mikesherov","followers_url":"https://api.github.com/users/mikesherov/followers","following_url":"https://api.github.com/users/mikesherov/following{/other_user}","gists_url":"https://api.github.com/users/mikesherov/gists{/gist_id}","starred_url":"https://api.github.com/users/mikesherov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikesherov/subscriptions","organizations_url":"https://api.github.com/users/mikesherov/orgs","repos_url":"https://api.github.com/users/mikesherov/repos","events_url":"https://api.github.com/users/mikesherov/events{/privacy}","received_events_url":"https://api.github.com/users/mikesherov/received_events","type":"User","site_admin":false},"body":":shrugs:","created_at":"2015-06-12T20:04:27Z","updated_at":"2015-06-12T20:04:27Z","html_url":"https://github.com/behance/BeFF/pull/92#discussion_r32349874","pull_request_url":"https://api.github.com/repos/behance/BeFF/pulls/92","_links":{"self":{"href":"https://api.github.com/repos/behance/BeFF/pulls/comments/32349874"},"html":{"href":"https://github.com/behance/BeFF/pull/92#discussion_r32349874"},"pull_request":{"href":"https://api.github.com/repos/behance/BeFF/pulls/92"}}},"pull_request":{"url":"https://api.github.com/repos/behance/BeFF/pulls/92","id":37474214,"html_url":"https://github.com/behance/BeFF/pull/92","diff_url":"https://github.com/behance/BeFF/pull/92.diff","patch_url":"https://github.com/behance/BeFF/pull/92.patch","issue_url":"https://api.github.com/repos/behance/BeFF/issues/92","number":92,"state":"open","locked":false,"title":"RFC: uploader as a promise","user":{"login":"mikesherov","id":364532,"avatar_url":"https://avatars.githubusercontent.com/u/364532?v=3","gravatar_id":"","url":"https://api.github.com/users/mikesherov","html_url":"https://github.com/mikesherov","followers_url":"https://api.github.com/users/mikesherov/followers","following_url":"https://api.github.com/users/mikesherov/following{/other_user}","gists_url":"https://api.github.com/users/mikesherov/gists{/gist_id}","starred_url":"https://api.github.com/users/mikesherov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikesherov/subscriptions","organizations_url":"https://api.github.com/users/mikesherov/orgs","repos_url":"https://api.github.com/users/mikesherov/repos","events_url":"https://api.github.com/users/mikesherov/events{/privacy}","received_events_url":"https://api.github.com/users/mikesherov/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-06-11T15:13:07Z","updated_at":"2015-06-12T20:04:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db585b53afeadcaed077166549c55bd1ac27c493","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/behance/BeFF/pulls/92/commits","review_comments_url":"https://api.github.com/repos/behance/BeFF/pulls/92/comments","review_comment_url":"https://api.github.com/repos/behance/BeFF/pulls/comments{/number}","comments_url":"https://api.github.com/repos/behance/BeFF/issues/92/comments","statuses_url":"https://api.github.com/repos/behance/BeFF/statuses/450931663b3350c0fa05cc999a17b1ed72f40f4b","head":{"label":"mikesherov:uploadPromise","ref":"uploadPromise","sha":"450931663b3350c0fa05cc999a17b1ed72f40f4b","user":{"login":"mikesherov","id":364532,"avatar_url":"https://avatars.githubusercontent.com/u/364532?v=3","gravatar_id":"","url":"https://api.github.com/users/mikesherov","html_url":"https://github.com/mikesherov","followers_url":"https://api.github.com/users/mikesherov/followers","following_url":"https://api.github.com/users/mikesherov/following{/other_user}","gists_url":"https://api.github.com/users/mikesherov/gists{/gist_id}","starred_url":"https://api.github.com/users/mikesherov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikesherov/subscriptions","organizations_url":"https://api.github.com/users/mikesherov/orgs","repos_url":"https://api.github.com/users/mikesherov/repos","events_url":"https://api.github.com/users/mikesherov/events{/privacy}","received_events_url":"https://api.github.com/users/mikesherov/received_events","type":"User","site_admin":false},"repo":{"id":20490072,"name":"BeFF","full_name":"mikesherov/BeFF","owner":{"login":"mikesherov","id":364532,"avatar_url":"https://avatars.githubusercontent.com/u/364532?v=3","gravatar_id":"","url":"https://api.github.com/users/mikesherov","html_url":"https://github.com/mikesherov","followers_url":"https://api.github.com/users/mikesherov/followers","following_url":"https://api.github.com/users/mikesherov/following{/other_user}","gists_url":"https://api.github.com/users/mikesherov/gists{/gist_id}","starred_url":"https://api.github.com/users/mikesherov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikesherov/subscriptions","organizations_url":"https://api.github.com/users/mikesherov/orgs","repos_url":"https://api.github.com/users/mikesherov/repos","events_url":"https://api.github.com/users/mikesherov/events{/privacy}","received_events_url":"https://api.github.com/users/mikesherov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikesherov/BeFF","description":"Behance Frontend Framework","fork":true,"url":"https://api.github.com/repos/mikesherov/BeFF","forks_url":"https://api.github.com/repos/mikesherov/BeFF/forks","keys_url":"https://api.github.com/repos/mikesherov/BeFF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikesherov/BeFF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikesherov/BeFF/teams","hooks_url":"https://api.github.com/repos/mikesherov/BeFF/hooks","issue_events_url":"https://api.github.com/repos/mikesherov/BeFF/issues/events{/number}","events_url":"https://api.github.com/repos/mikesherov/BeFF/events","assignees_url":"https://api.github.com/repos/mikesherov/BeFF/assignees{/user}","branches_url":"https://api.github.com/repos/mikesherov/BeFF/branches{/branch}","tags_url":"https://api.github.com/repos/mikesherov/BeFF/tags","blobs_url":"https://api.github.com/repos/mikesherov/BeFF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikesherov/BeFF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikesherov/BeFF/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikesherov/BeFF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikesherov/BeFF/statuses/{sha}","languages_url":"https://api.github.com/repos/mikesherov/BeFF/languages","stargazers_url":"https://api.github.com/repos/mikesherov/BeFF/stargazers","contributors_url":"https://api.github.com/repos/mikesherov/BeFF/contributors","subscribers_url":"https://api.github.com/repos/mikesherov/BeFF/subscribers","subscription_url":"https://api.github.com/repos/mikesherov/BeFF/subscription","commits_url":"https://api.github.com/repos/mikesherov/BeFF/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikesherov/BeFF/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikesherov/BeFF/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikesherov/BeFF/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikesherov/BeFF/contents/{+path}","compare_url":"https://api.github.com/repos/mikesherov/BeFF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikesherov/BeFF/merges","archive_url":"https://api.github.com/repos/mikesherov/BeFF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikesherov/BeFF/downloads","issues_url":"https://api.github.com/repos/mikesherov/BeFF/issues{/number}","pulls_url":"https://api.github.com/repos/mikesherov/BeFF/pulls{/number}","milestones_url":"https://api.github.com/repos/mikesherov/BeFF/milestones{/number}","notifications_url":"https://api.github.com/repos/mikesherov/BeFF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikesherov/BeFF/labels{/name}","releases_url":"https://api.github.com/repos/mikesherov/BeFF/releases{/id}","created_at":"2014-06-04T15:58:27Z","updated_at":"2014-06-04T16:03:39Z","pushed_at":"2015-06-12T19:45:34Z","git_url":"git://github.com/mikesherov/BeFF.git","ssh_url":"git@github.com:mikesherov/BeFF.git","clone_url":"https://github.com/mikesherov/BeFF.git","svn_url":"https://github.com/mikesherov/BeFF","homepage":null,"size":188,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"behance:master","ref":"master","sha":"018213acc3fac3546263e49f1470078066bc7bed","user":{"login":"behance","id":1197743,"avatar_url":"https://avatars.githubusercontent.com/u/1197743?v=3","gravatar_id":"","url":"https://api.github.com/users/behance","html_url":"https://github.com/behance","followers_url":"https://api.github.com/users/behance/followers","following_url":"https://api.github.com/users/behance/following{/other_user}","gists_url":"https://api.github.com/users/behance/gists{/gist_id}","starred_url":"https://api.github.com/users/behance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behance/subscriptions","organizations_url":"https://api.github.com/users/behance/orgs","repos_url":"https://api.github.com/users/behance/repos","events_url":"https://api.github.com/users/behance/events{/privacy}","received_events_url":"https://api.github.com/users/behance/received_events","type":"Organization","site_admin":false},"repo":{"id":19325681,"name":"BeFF","full_name":"behance/BeFF","owner":{"login":"behance","id":1197743,"avatar_url":"https://avatars.githubusercontent.com/u/1197743?v=3","gravatar_id":"","url":"https://api.github.com/users/behance","html_url":"https://github.com/behance","followers_url":"https://api.github.com/users/behance/followers","following_url":"https://api.github.com/users/behance/following{/other_user}","gists_url":"https://api.github.com/users/behance/gists{/gist_id}","starred_url":"https://api.github.com/users/behance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behance/subscriptions","organizations_url":"https://api.github.com/users/behance/orgs","repos_url":"https://api.github.com/users/behance/repos","events_url":"https://api.github.com/users/behance/events{/privacy}","received_events_url":"https://api.github.com/users/behance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/behance/BeFF","description":"Behance Frontend Framework","fork":false,"url":"https://api.github.com/repos/behance/BeFF","forks_url":"https://api.github.com/repos/behance/BeFF/forks","keys_url":"https://api.github.com/repos/behance/BeFF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/behance/BeFF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/behance/BeFF/teams","hooks_url":"https://api.github.com/repos/behance/BeFF/hooks","issue_events_url":"https://api.github.com/repos/behance/BeFF/issues/events{/number}","events_url":"https://api.github.com/repos/behance/BeFF/events","assignees_url":"https://api.github.com/repos/behance/BeFF/assignees{/user}","branches_url":"https://api.github.com/repos/behance/BeFF/branches{/branch}","tags_url":"https://api.github.com/repos/behance/BeFF/tags","blobs_url":"https://api.github.com/repos/behance/BeFF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/behance/BeFF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/behance/BeFF/git/refs{/sha}","trees_url":"https://api.github.com/repos/behance/BeFF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/behance/BeFF/statuses/{sha}","languages_url":"https://api.github.com/repos/behance/BeFF/languages","stargazers_url":"https://api.github.com/repos/behance/BeFF/stargazers","contributors_url":"https://api.github.com/repos/behance/BeFF/contributors","subscribers_url":"https://api.github.com/repos/behance/BeFF/subscribers","subscription_url":"https://api.github.com/repos/behance/BeFF/subscription","commits_url":"https://api.github.com/repos/behance/BeFF/commits{/sha}","git_commits_url":"https://api.github.com/repos/behance/BeFF/git/commits{/sha}","comments_url":"https://api.github.com/repos/behance/BeFF/comments{/number}","issue_comment_url":"https://api.github.com/repos/behance/BeFF/issues/comments{/number}","contents_url":"https://api.github.com/repos/behance/BeFF/contents/{+path}","compare_url":"https://api.github.com/repos/behance/BeFF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/behance/BeFF/merges","archive_url":"https://api.github.com/repos/behance/BeFF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/behance/BeFF/downloads","issues_url":"https://api.github.com/repos/behance/BeFF/issues{/number}","pulls_url":"https://api.github.com/repos/behance/BeFF/pulls{/number}","milestones_url":"https://api.github.com/repos/behance/BeFF/milestones{/number}","notifications_url":"https://api.github.com/repos/behance/BeFF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/behance/BeFF/labels{/name}","releases_url":"https://api.github.com/repos/behance/BeFF/releases{/id}","created_at":"2014-04-30T20:06:04Z","updated_at":"2015-04-05T10:46:56Z","pushed_at":"2015-06-12T19:45:34Z","git_url":"git://github.com/behance/BeFF.git","ssh_url":"git@github.com:behance/BeFF.git","clone_url":"https://github.com/behance/BeFF.git","svn_url":"https://github.com/behance/BeFF","homepage":null,"size":1118,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/behance/BeFF/pulls/92"},"html":{"href":"https://github.com/behance/BeFF/pull/92"},"issue":{"href":"https://api.github.com/repos/behance/BeFF/issues/92"},"comments":{"href":"https://api.github.com/repos/behance/BeFF/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/behance/BeFF/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/behance/BeFF/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/behance/BeFF/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/behance/BeFF/statuses/450931663b3350c0fa05cc999a17b1ed72f40f4b"}}}}