{"action":"created","issue":{"url":"https://api.github.com/repos/then/promise/issues/69","labels_url":"https://api.github.com/repos/then/promise/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/then/promise/issues/69/comments","events_url":"https://api.github.com/repos/then/promise/issues/69/events","html_url":"https://github.com/then/promise/pull/69","id":53311063,"number":69,"title":"Changing denodeify to support functions that return promises","user":{"login":"TehShrike","id":1141869,"avatar_url":"https://avatars.githubusercontent.com/u/1141869?v=3","gravatar_id":"","url":"https://api.github.com/users/TehShrike","html_url":"https://github.com/TehShrike","followers_url":"https://api.github.com/users/TehShrike/followers","following_url":"https://api.github.com/users/TehShrike/following{/other_user}","gists_url":"https://api.github.com/users/TehShrike/gists{/gist_id}","starred_url":"https://api.github.com/users/TehShrike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehShrike/subscriptions","organizations_url":"https://api.github.com/users/TehShrike/orgs","repos_url":"https://api.github.com/users/TehShrike/repos","events_url":"https://api.github.com/users/TehShrike/events{/privacy}","received_events_url":"https://api.github.com/users/TehShrike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-03T18:17:19Z","updated_at":"2015-01-09T03:43:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/then/promise/pulls/69","html_url":"https://github.com/then/promise/pull/69","diff_url":"https://github.com/then/promise/pull/69.diff","patch_url":"https://github.com/then/promise/pull/69.patch"},"body":"I'm writing a library that can be extended by consumers who want to overwrite some of the functions.\r\n\r\nInternally, I am using promises.  However, I would like consumers to have the option of writing implementing functions that either call a callback, or return a promise, as they prefer.\r\n\r\nPromise.denodeify is nearly perfect, except that it forces all implementers to use a callback, removing the option of returning a promise.\r\n\r\nThis pull request changes denodeify so that if the wrapped function returns a thenable object, that object is used to resolve the promise."},"comment":{"url":"https://api.github.com/repos/then/promise/issues/comments/69289434","html_url":"https://github.com/then/promise/pull/69#issuecomment-69289434","issue_url":"https://api.github.com/repos/then/promise/issues/69","id":69289434,"user":{"login":"TehShrike","id":1141869,"avatar_url":"https://avatars.githubusercontent.com/u/1141869?v=3","gravatar_id":"","url":"https://api.github.com/users/TehShrike","html_url":"https://github.com/TehShrike","followers_url":"https://api.github.com/users/TehShrike/followers","following_url":"https://api.github.com/users/TehShrike/following{/other_user}","gists_url":"https://api.github.com/users/TehShrike/gists{/gist_id}","starred_url":"https://api.github.com/users/TehShrike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehShrike/subscriptions","organizations_url":"https://api.github.com/users/TehShrike/orgs","repos_url":"https://api.github.com/users/TehShrike/repos","events_url":"https://api.github.com/users/TehShrike/events{/privacy}","received_events_url":"https://api.github.com/users/TehShrike/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T03:43:06Z","updated_at":"2015-01-09T03:43:06Z","body":"Is calling the callback synchronously and also returning a promise any worse than resolving a promise asynchronously multiple times?  In my mind, it's just all Wrong Code You Shouldn't Write Because It Won't Work."}}