Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Created August 14, 2015 23:19
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/017ba596a92f39e2269a to your computer and use it in GitHub Desktop.
Save thiagopnts/017ba596a92f39e2269a 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