Forked from scottgonzalez/amplify.request.deferred.js
Created
September 20, 2012 02:43
-
-
Save elijahmanor/3753658 to your computer and use it in GitHub Desktop.
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
function deferredRequest( resource, data ) { | |
return $.Deferred(function( dfd ) { | |
amplify.request({ | |
resourceId: resource, | |
data: data, | |
success: dfd.resolve, | |
error: dfd.reject | |
}); | |
}).promise(); | |
} | |
deferredRequest( "foo" ).then(function( data ) { | |
console.log( "dfd", data ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment