Skip to content

Instantly share code, notes, and snippets.

@matthisk
Last active October 28, 2015 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthisk/127ff7ab45a628ed30df to your computer and use it in GitHub Desktop.
Save matthisk/127ff7ab45a628ed30df to your computer and use it in GitHub Desktop.
stream-js example: Promises
var client = stream.connect('API_KEY', 'API_SECRET'),
user1 = client.feed('user','1');
user1.follow('user', '2')
.then(function(body) {
return user1.get({ limit: 1 });
})
.then(function(body) {
console.log(body);
})
.catch(function(error) {
console.error(error.response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment