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
Post a Comment