Created
August 14, 2015 23:19
-
-
Save thiagopnts/017ba596a92f39e2269a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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