Skip to content

Instantly share code, notes, and snippets.

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