Created
May 9, 2014 23:57
-
-
Save joshbedo/c1a1fa97d0661f7a2124 to your computer and use it in GitHub Desktop.
fetching an endpoint
This file contains hidden or 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
fetchPromise: (endpoint, params = {})-> | |
deferred = $.Deferred (d)=> | |
@fetch endpoint, params, (res)-> | |
d.resolve res | |
, | |
(res) -> | |
d.reject res | |
deferred.promise() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment