{"action":"closed","issue":{"url":"https://api.github.com/repos/stellar/js-stellar-sdk/issues/21","labels_url":"https://api.github.com/repos/stellar/js-stellar-sdk/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/stellar/js-stellar-sdk/issues/21/comments","events_url":"https://api.github.com/repos/stellar/js-stellar-sdk/issues/21/events","html_url":"https://github.com/stellar/js-stellar-sdk/issues/21","id":97810624,"number":21,"title":"Bug in streaming -- no method \"then\"","user":{"login":"dydt","id":305198,"avatar_url":"https://avatars.githubusercontent.com/u/305198?v=3","gravatar_id":"","url":"https://api.github.com/users/dydt","html_url":"https://github.com/dydt","followers_url":"https://api.github.com/users/dydt/followers","following_url":"https://api.github.com/users/dydt/following{/other_user}","gists_url":"https://api.github.com/users/dydt/gists{/gist_id}","starred_url":"https://api.github.com/users/dydt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dydt/subscriptions","organizations_url":"https://api.github.com/users/dydt/orgs","repos_url":"https://api.github.com/users/dydt/repos","events_url":"https://api.github.com/users/dydt/events{/privacy}","received_events_url":"https://api.github.com/users/dydt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stellar/js-stellar-sdk/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"dydt","id":305198,"avatar_url":"https://avatars.githubusercontent.com/u/305198?v=3","gravatar_id":"","url":"https://api.github.com/users/dydt","html_url":"https://github.com/dydt","followers_url":"https://api.github.com/users/dydt/followers","following_url":"https://api.github.com/users/dydt/following{/other_user}","gists_url":"https://api.github.com/users/dydt/gists{/gist_id}","starred_url":"https://api.github.com/users/dydt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dydt/subscriptions","organizations_url":"https://api.github.com/users/dydt/orgs","repos_url":"https://api.github.com/users/dydt/repos","events_url":"https://api.github.com/users/dydt/events{/privacy}","received_events_url":"https://api.github.com/users/dydt/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-28T21:56:47Z","updated_at":"2015-09-28T21:52:01Z","closed_at":"2015-09-28T21:52:01Z","body":"In the `/docs/README`, there is an example of how to stream an account's transaction history.  I tried the code below, basically copy-and-pasted from the example:\r\n\r\n```\r\nvar StellarLib = require('./js-stellar-lib')\r\nvar server = new StellarLib.Server({hostname:'horizon-testnet.stellar.org', secure:true, port:443});\r\n\r\nvar streamingMessageHandler = function (message) {\r\n    console.log(message);\r\n};\r\n\r\nserver.accounts(\"gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe\", \"transactions\",\r\n    {\r\n        streaming: {\r\n            onmessage: streamingMessageHandler\r\n        }\r\n    })\r\n    .then(function (es) {\r\n        console.log(es)\r\n    })\r\n    .catch(function (err) {\r\n        console.log(err);\r\n    });\r\n```\r\nand I get the error\r\n\r\n```\r\n/Users/diyang/workspace/client_endpoints_examples.js:89\r\n    .then(function (es) {\r\n     ^\r\nTypeError: Object #<EventSource> has no method 'then'\r\n    at Object.<anonymous> (/Users/diyang/workspace/client_endpoints_examples.js:89:6)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Function.Module.runMain (module.js:497:10)\r\n    at startup (node.js:119:16)\r\n    at node.js:929:3\r\n```\r\n\r\n"}}