{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/80","labels_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/80/comments","events_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/80/events","html_url":"https://github.com/ipfs/node-ipfs-api/issues/80","id":112667138,"number":80,"title":"Use Promises instead of callbacks","user":{"login":"VictorBjelkholm","id":459764,"avatar_url":"https://avatars.githubusercontent.com/u/459764?v=3","gravatar_id":"","url":"https://api.github.com/users/VictorBjelkholm","html_url":"https://github.com/VictorBjelkholm","followers_url":"https://api.github.com/users/VictorBjelkholm/followers","following_url":"https://api.github.com/users/VictorBjelkholm/following{/other_user}","gists_url":"https://api.github.com/users/VictorBjelkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/VictorBjelkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VictorBjelkholm/subscriptions","organizations_url":"https://api.github.com/users/VictorBjelkholm/orgs","repos_url":"https://api.github.com/users/VictorBjelkholm/repos","events_url":"https://api.github.com/users/VictorBjelkholm/events{/privacy}","received_events_url":"https://api.github.com/users/VictorBjelkholm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-21T19:56:57Z","updated_at":"2015-10-22T14:22:37Z","closed_at":null,"body":"Most environments now support the more pleasant API of `Promise` ( https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Promise ), that is easier to handle and chain together. We should think about migrating to start using promises instead of callbacks where applicable.\r\n\r\nList of browsers that supports it current: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Promise\r\n(IE doesn't support it + some olders versions of other browsers, probably have to provide an existing shim as well...)\r\n\r\nIn node, promises have been natively supported since 0.12 so shouldn't be an issue there."},"comment":{"url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/comments/150239580","html_url":"https://github.com/ipfs/node-ipfs-api/issues/80#issuecomment-150239580","issue_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/80","id":150239580,"user":{"login":"RichardLitt","id":910753,"avatar_url":"https://avatars.githubusercontent.com/u/910753?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardLitt","html_url":"https://github.com/RichardLitt","followers_url":"https://api.github.com/users/RichardLitt/followers","following_url":"https://api.github.com/users/RichardLitt/following{/other_user}","gists_url":"https://api.github.com/users/RichardLitt/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardLitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardLitt/subscriptions","organizations_url":"https://api.github.com/users/RichardLitt/orgs","repos_url":"https://api.github.com/users/RichardLitt/repos","events_url":"https://api.github.com/users/RichardLitt/events{/privacy}","received_events_url":"https://api.github.com/users/RichardLitt/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T14:22:37Z","updated_at":"2015-10-22T14:22:37Z","body":"@VictorBjelkholm:\r\n>  cosmetic change\r\n\r\nBingo. Promises and Callbacks are the higher-level equivalent of semicolons and no semicolons. Best to avoid entirely if you're not doing a major refactor with new team. "}}