Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Created August 14, 2015 23:18
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 thiagopnts/ee0666b28b924c6829a2 to your computer and use it in GitHub Desktop.
Save thiagopnts/ee0666b28b924c6829a2 to your computer and use it in GitHub Desktop.
var Promise = require('bluebird');
var a = {context: 'context a'};
function set() {
console.log(this.context);
}
Promise.resolve().bind(a).then(function() {
console.log(this.context);
return Promise.resolve().then(set);
}).then(function() {
console.log(this.context);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment