Skip to content

Instantly share code, notes, and snippets.

@scottgonzalez
Created April 19, 2012 23:53
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save scottgonzalez/2424902 to your computer and use it in GitHub Desktop.
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