Comparing version 0.10.2-0 to 0.10.2-1
10
API.md
@@ -28,3 +28,3 @@ #API Reference | ||
- [`.progress(dynamic value)`](#progressdynamic-value---undefined) | ||
- [`.asCallback`](#ascallback---function) | ||
- [`.callback`](#callback---function) | ||
- [Promisification](#promisification) | ||
@@ -543,3 +543,3 @@ - [`Promise.promisify(Function nodeFunction [, dynamic receiver])`](#promisepromisifyfunction-nodefunction--dynamic-receiver---function) | ||
return db.queryAsync(input).then(function(value) { | ||
return db.queryAsync(input).bind(this).then(function(value) { | ||
this.someCachedValue = value; | ||
@@ -735,3 +735,3 @@ return value; | ||
#####`.asCallback` -> `Function` | ||
#####`.callback` -> `Function` | ||
@@ -746,3 +746,3 @@ Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. | ||
var resolver = Promise.defer(); | ||
fs.readFile("abc.txt", resolver.asCallback); | ||
fs.readFile("abc.txt", resolver.callback); | ||
return resolver.promise; | ||
@@ -764,3 +764,3 @@ } | ||
The `asCallback` is actually an accessor property (except on legacy browsers where it's eager data property) - so save the result if you need to call it multiple times. | ||
The `callback` is actually an accessor property (except on legacy browsers where it's eager data property) - so save the result if you need to call it multiple times. | ||
@@ -767,0 +767,0 @@ This is more efficient way of promisification than using `new Promise`. |
@@ -67,2 +67,3 @@ /** | ||
this.asCallback = nodebackForResolver( this ); | ||
this.callback = this.asCallback; | ||
}; | ||
@@ -76,7 +77,9 @@ } | ||
if( haveGetters ) { | ||
Object.defineProperty( PromiseResolver.prototype, "asCallback", { | ||
var prop = { | ||
get: function() { | ||
return nodebackForResolver( this ); | ||
} | ||
}); | ||
}; | ||
Object.defineProperty(PromiseResolver.prototype, "asCallback", prop); | ||
Object.defineProperty(PromiseResolver.prototype, "callback", prop); | ||
} | ||
@@ -83,0 +86,0 @@ |
@@ -67,2 +67,3 @@ /** | ||
this.asCallback = nodebackForResolver( this ); | ||
this.callback = this.asCallback; | ||
}; | ||
@@ -76,7 +77,9 @@ } | ||
if( haveGetters ) { | ||
Object.defineProperty( PromiseResolver.prototype, "asCallback", { | ||
var prop = { | ||
get: function() { | ||
return nodebackForResolver( this ); | ||
} | ||
}); | ||
}; | ||
Object.defineProperty(PromiseResolver.prototype, "asCallback", prop); | ||
Object.defineProperty(PromiseResolver.prototype, "callback", prop); | ||
} | ||
@@ -83,0 +86,0 @@ |
{ | ||
"name": "bluebird", | ||
"description": "Full featured Promises/A+ implementation with exceptionally good performance", | ||
"version": "0.10.2-0", | ||
"version": "0.10.2-1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "promise", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
447477
9190