Created
October 23, 2012 02:39
-
-
Save aaronj1335/3936362 to your computer and use it in GitHub Desktop.
optionally returning a deferred
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
something.then(function() { | |
if (config.somethingElse) { | |
return somethingElse(); | |
} | |
}); |
It's perfectly ok. The final result would be undefined or resolved value of promise returned by somethingElse
. Test it :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also: i'm using q, and if i want to ensure that any exceptions thrown are caught, i would need to add a
.end()
after the.then()
correct?