Comparing version 0.1.3 to 0.1.4
31
index.js
@@ -184,20 +184,25 @@ | ||
var promise = pinkySwear(); | ||
var promise = pinkySwear(), | ||
self = this; | ||
this._ref.auth(authToken, function(err, info) { | ||
nextTick(function() { | ||
if (err !== null) { | ||
promise(false, [err]); | ||
} else { | ||
promise(true, [info]); | ||
} | ||
self._ref.auth(authToken, function(err, info) { | ||
if (typeof onComplete === 'function') { | ||
nextTick(function() { | ||
onComplete(err, info); | ||
}); | ||
} | ||
if (err !== null) { | ||
promise(false, [err]); | ||
} else { | ||
promise(true, [info]); | ||
} | ||
}, onCancel); | ||
if (typeof onComplete === 'function') { | ||
nextTick(function() { | ||
onComplete(err, info); | ||
}); | ||
} | ||
}, onCancel); | ||
}); | ||
return promise; | ||
@@ -204,0 +209,0 @@ |
{ | ||
"name": "fireproof", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Promises for Firebase objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
26684
669