{"action":"opened","number":630,"pull_request":{"url":"https://api.github.com/repos/acdlite/recompose/pulls/630","id":176348673,"html_url":"https://github.com/acdlite/recompose/pull/630","diff_url":"https://github.com/acdlite/recompose/pull/630.diff","patch_url":"https://github.com/acdlite/recompose/pull/630.patch","issue_url":"https://api.github.com/repos/acdlite/recompose/issues/630","number":630,"state":"open","locked":false,"title":"Implement withPromiseHandler","user":{"login":"MrBr","id":6218559,"avatar_url":"https://avatars2.githubusercontent.com/u/6218559?v=4","gravatar_id":"","url":"https://api.github.com/users/MrBr","html_url":"https://github.com/MrBr","followers_url":"https://api.github.com/users/MrBr/followers","following_url":"https://api.github.com/users/MrBr/following{/other_user}","gists_url":"https://api.github.com/users/MrBr/gists{/gist_id}","starred_url":"https://api.github.com/users/MrBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrBr/subscriptions","organizations_url":"https://api.github.com/users/MrBr/orgs","repos_url":"https://api.github.com/users/MrBr/repos","events_url":"https://api.github.com/users/MrBr/events{/privacy}","received_events_url":"https://api.github.com/users/MrBr/received_events","type":"User","site_admin":false},"body":"Hey,\r\n\r\nJust want to share an idea here, I think it fits recompose.\r\n\r\nBasically, when working with promises in a component I want to preserve React lifecycle or to be more precise be notified that promise is resolved through props update. There is also issue with loading status, there is no easy way to tell if a promise is resolved (usually it ends being saved in the component state).\r\n\r\n`withPromiseHandler` provides a method to the wrapped component for registering a promise and in return, it will handle promise. When the promise is resolved, successfully or with error, the result will be saved in the state of the HOC and passed to the wrapped component. \r\n\r\nA bonus is `loading` status which is added to the promise object so that the wrapped component can easily and without any additional state handle that case.\r\n\r\nThe ultimate thing is that every time promise changes, a wrapped component gets a chance to render that new state automatically.\r\n\r\nIf you think this fits recompose I can do any needed changes and write tests.\r\n\r\nCheers!","created_at":"2018-03-20T23:18:49Z","updated_at":"2018-03-20T23:18:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/acdlite/recompose/pulls/630/commits","review_comments_url":"https://api.github.com/repos/acdlite/recompose/pulls/630/comments","review_comment_url":"https://api.github.com/repos/acdlite/recompose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acdlite/recompose/issues/630/comments","statuses_url":"https://api.github.com/repos/acdlite/recompose/statuses/7c4a91fcad2c1d91d985e39f0809b1771ca5f95e","head":{"label":"MrBr:with-promise-handler","ref":"with-promise-handler","sha":"7c4a91fcad2c1d91d985e39f0809b1771ca5f95e","user":{"login":"MrBr","id":6218559,"avatar_url":"https://avatars2.githubusercontent.com/u/6218559?v=4","gravatar_id":"","url":"https://api.github.com/users/MrBr","html_url":"https://github.com/MrBr","followers_url":"https://api.github.com/users/MrBr/followers","following_url":"https://api.github.com/users/MrBr/following{/other_user}","gists_url":"https://api.github.com/users/MrBr/gists{/gist_id}","starred_url":"https://api.github.com/users/MrBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrBr/subscriptions","organizations_url":"https://api.github.com/users/MrBr/orgs","repos_url":"https://api.github.com/users/MrBr/repos","events_url":"https://api.github.com/users/MrBr/events{/privacy}","received_events_url":"https://api.github.com/users/MrBr/received_events","type":"User","site_admin":false},"repo":{"id":126092773,"name":"recompose","full_name":"MrBr/recompose","owner":{"login":"MrBr","id":6218559,"avatar_url":"https://avatars2.githubusercontent.com/u/6218559?v=4","gravatar_id":"","url":"https://api.github.com/users/MrBr","html_url":"https://github.com/MrBr","followers_url":"https://api.github.com/users/MrBr/followers","following_url":"https://api.github.com/users/MrBr/following{/other_user}","gists_url":"https://api.github.com/users/MrBr/gists{/gist_id}","starred_url":"https://api.github.com/users/MrBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrBr/subscriptions","organizations_url":"https://api.github.com/users/MrBr/orgs","repos_url":"https://api.github.com/users/MrBr/repos","events_url":"https://api.github.com/users/MrBr/events{/privacy}","received_events_url":"https://api.github.com/users/MrBr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MrBr/recompose","description":"A React utility belt for function components and higher-order components.","fork":true,"url":"https://api.github.com/repos/MrBr/recompose","forks_url":"https://api.github.com/repos/MrBr/recompose/forks","keys_url":"https://api.github.com/repos/MrBr/recompose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MrBr/recompose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MrBr/recompose/teams","hooks_url":"https://api.github.com/repos/MrBr/recompose/hooks","issue_events_url":"https://api.github.com/repos/MrBr/recompose/issues/events{/number}","events_url":"https://api.github.com/repos/MrBr/recompose/events","assignees_url":"https://api.github.com/repos/MrBr/recompose/assignees{/user}","branches_url":"https://api.github.com/repos/MrBr/recompose/branches{/branch}","tags_url":"https://api.github.com/repos/MrBr/recompose/tags","blobs_url":"https://api.github.com/repos/MrBr/recompose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MrBr/recompose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MrBr/recompose/git/refs{/sha}","trees_url":"https://api.github.com/repos/MrBr/recompose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MrBr/recompose/statuses/{sha}","languages_url":"https://api.github.com/repos/MrBr/recompose/languages","stargazers_url":"https://api.github.com/repos/MrBr/recompose/stargazers","contributors_url":"https://api.github.com/repos/MrBr/recompose/contributors","subscribers_url":"https://api.github.com/repos/MrBr/recompose/subscribers","subscription_url":"https://api.github.com/repos/MrBr/recompose/subscription","commits_url":"https://api.github.com/repos/MrBr/recompose/commits{/sha}","git_commits_url":"https://api.github.com/repos/MrBr/recompose/git/commits{/sha}","comments_url":"https://api.github.com/repos/MrBr/recompose/comments{/number}","issue_comment_url":"https://api.github.com/repos/MrBr/recompose/issues/comments{/number}","contents_url":"https://api.github.com/repos/MrBr/recompose/contents/{+path}","compare_url":"https://api.github.com/repos/MrBr/recompose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MrBr/recompose/merges","archive_url":"https://api.github.com/repos/MrBr/recompose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MrBr/recompose/downloads","issues_url":"https://api.github.com/repos/MrBr/recompose/issues{/number}","pulls_url":"https://api.github.com/repos/MrBr/recompose/pulls{/number}","milestones_url":"https://api.github.com/repos/MrBr/recompose/milestones{/number}","notifications_url":"https://api.github.com/repos/MrBr/recompose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MrBr/recompose/labels{/name}","releases_url":"https://api.github.com/repos/MrBr/recompose/releases{/id}","deployments_url":"https://api.github.com/repos/MrBr/recompose/deployments","created_at":"2018-03-20T22:52:28Z","updated_at":"2018-03-20T22:52:30Z","pushed_at":"2018-03-20T22:55:33Z","git_url":"git://github.com/MrBr/recompose.git","ssh_url":"git@github.com:MrBr/recompose.git","clone_url":"https://github.com/MrBr/recompose.git","svn_url":"https://github.com/MrBr/recompose","homepage":"","size":894,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"acdlite:master","ref":"master","sha":"47f4794b8017a61a2c35077a532384ffd5f54c0e","user":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars0.githubusercontent.com/u/3624098?v=4","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"repo":{"id":43797718,"name":"recompose","full_name":"acdlite/recompose","owner":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars0.githubusercontent.com/u/3624098?v=4","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acdlite/recompose","description":"A React utility belt for function components and higher-order components.","fork":false,"url":"https://api.github.com/repos/acdlite/recompose","forks_url":"https://api.github.com/repos/acdlite/recompose/forks","keys_url":"https://api.github.com/repos/acdlite/recompose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acdlite/recompose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acdlite/recompose/teams","hooks_url":"https://api.github.com/repos/acdlite/recompose/hooks","issue_events_url":"https://api.github.com/repos/acdlite/recompose/issues/events{/number}","events_url":"https://api.github.com/repos/acdlite/recompose/events","assignees_url":"https://api.github.com/repos/acdlite/recompose/assignees{/user}","branches_url":"https://api.github.com/repos/acdlite/recompose/branches{/branch}","tags_url":"https://api.github.com/repos/acdlite/recompose/tags","blobs_url":"https://api.github.com/repos/acdlite/recompose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acdlite/recompose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acdlite/recompose/git/refs{/sha}","trees_url":"https://api.github.com/repos/acdlite/recompose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acdlite/recompose/statuses/{sha}","languages_url":"https://api.github.com/repos/acdlite/recompose/languages","stargazers_url":"https://api.github.com/repos/acdlite/recompose/stargazers","contributors_url":"https://api.github.com/repos/acdlite/recompose/contributors","subscribers_url":"https://api.github.com/repos/acdlite/recompose/subscribers","subscription_url":"https://api.github.com/repos/acdlite/recompose/subscription","commits_url":"https://api.github.com/repos/acdlite/recompose/commits{/sha}","git_commits_url":"https://api.github.com/repos/acdlite/recompose/git/commits{/sha}","comments_url":"https://api.github.com/repos/acdlite/recompose/comments{/number}","issue_comment_url":"https://api.github.com/repos/acdlite/recompose/issues/comments{/number}","contents_url":"https://api.github.com/repos/acdlite/recompose/contents/{+path}","compare_url":"https://api.github.com/repos/acdlite/recompose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acdlite/recompose/merges","archive_url":"https://api.github.com/repos/acdlite/recompose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acdlite/recompose/downloads","issues_url":"https://api.github.com/repos/acdlite/recompose/issues{/number}","pulls_url":"https://api.github.com/repos/acdlite/recompose/pulls{/number}","milestones_url":"https://api.github.com/repos/acdlite/recompose/milestones{/number}","notifications_url":"https://api.github.com/repos/acdlite/recompose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acdlite/recompose/labels{/name}","releases_url":"https://api.github.com/repos/acdlite/recompose/releases{/id}","deployments_url":"https://api.github.com/repos/acdlite/recompose/deployments","created_at":"2015-10-07T05:54:51Z","updated_at":"2018-03-20T22:57:53Z","pushed_at":"2018-03-19T15:26:29Z","git_url":"git://github.com/acdlite/recompose.git","ssh_url":"git@github.com:acdlite/recompose.git","clone_url":"https://github.com/acdlite/recompose.git","svn_url":"https://github.com/acdlite/recompose","homepage":"","size":894,"stargazers_count":9603,"watchers_count":9603,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":718,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":718,"open_issues":42,"watchers":9603,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acdlite/recompose/pulls/630"},"html":{"href":"https://github.com/acdlite/recompose/pull/630"},"issue":{"href":"https://api.github.com/repos/acdlite/recompose/issues/630"},"comments":{"href":"https://api.github.com/repos/acdlite/recompose/issues/630/comments"},"review_comments":{"href":"https://api.github.com/repos/acdlite/recompose/pulls/630/comments"},"review_comment":{"href":"https://api.github.com/repos/acdlite/recompose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acdlite/recompose/pulls/630/commits"},"statuses":{"href":"https://api.github.com/repos/acdlite/recompose/statuses/7c4a91fcad2c1d91d985e39f0809b1771ca5f95e"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":59,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"MrBr"}}