Bluebird, Promise.bind - how to access bound context in pending promise? -



Bluebird, Promise.bind - how to access bound context in pending promise? -

someone pointed me promise.bind() in bluebird able have context in promise chain.

however, utilize case requires me utilize context "from outside" when have reference promise object (the 1 then , catch api).

is possible?

sure, .bind has non-static counterpart.

yourpromise.bind({x:3}).then(function(data){ console.log("yourpromise fulfilled with", data, "and x ", this.x); });

here fiddle illustrating usage.

promise bluebird

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -