Created
October 3, 2014 19:31
-
-
Save bleathem/d57ab0ca227f1dafb01c to your computer and use it in GitHub Desktop.
The commit where I "got" javascript promises.
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
@@ -64,15 +64,7 @@ | |
}; | |
return function(authWindow) { | |
- var deferred = $q.defer(); | |
- getCodePromise(authWindow).then(function(code) { | |
- getTokenPromise(code).then(function(data) { | |
- deferred.resolve(data); | |
- }, function(error) { | |
- deferred.reject(error); | |
- }); | |
- }); | |
- return deferred.promise; | |
+ return getCodePromise(authWindow).then(getTokenPromise); | |
}; | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment