{"action":"closed","issue":{"url":"https://api.github.com/repos/bitovi/syn/issues/78","labels_url":"https://api.github.com/repos/bitovi/syn/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/bitovi/syn/issues/78/comments","events_url":"https://api.github.com/repos/bitovi/syn/issues/78/events","html_url":"https://github.com/bitovi/syn/issues/78","id":57551980,"number":78,"title":"Suggestion: use a futures API rather than callbacks","user":{"login":"fresheneesz","id":149531,"avatar_url":"https://avatars.githubusercontent.com/u/149531?v=3","gravatar_id":"","url":"https://api.github.com/users/fresheneesz","html_url":"https://github.com/fresheneesz","followers_url":"https://api.github.com/users/fresheneesz/followers","following_url":"https://api.github.com/users/fresheneesz/following{/other_user}","gists_url":"https://api.github.com/users/fresheneesz/gists{/gist_id}","starred_url":"https://api.github.com/users/fresheneesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fresheneesz/subscriptions","organizations_url":"https://api.github.com/users/fresheneesz/orgs","repos_url":"https://api.github.com/users/fresheneesz/repos","events_url":"https://api.github.com/users/fresheneesz/events{/privacy}","received_events_url":"https://api.github.com/users/fresheneesz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-13T02:45:56Z","updated_at":"2015-02-13T06:54:25Z","closed_at":"2015-02-13T06:54:25Z","body":"So instead of writing: \r\n\r\n```\r\n    syn.type(a, \"x\", function() {\r\n        syn.click(b, function() {\r\n            syn.click(c, function() {\r\n               syn.click(d)\r\n           })\r\n        })\r\n    })\r\n```\r\n\r\nyou could write something like:\r\n\r\n```\r\nsyn.type(a, \"x\").then(function() {\r\n     return syn.click(b)\r\n}).then(function() {\r\n     return syn.click(c)\r\n}).then(function() {\r\n     return syn.click(d)\r\n}).done()\r\n```\r\n\r\nso you don't get all stuck in callback hell. I'd suggest a futures library but i don't wanna plug my stuff too much all at once ; )"}}