mikehostetler / amplify

AmplifyJS
http://amplifyjs.com
GNU General Public License v2.0
1.45k stars 143 forks source link

Promise interface support #68

Closed khakulov closed 11 years ago

khakulov commented 11 years ago

amplify.request() should return jQuery.Deferred() object.

Example:

$.when(amplify.request("resource1"),
       amplify.request("resource2"))
 .then(function(data1, data2) {
           console.log("Resources are loaded!");
       },
       function() {
           console.log("Requests failed!");
       }
)```
scottgonzalez commented 11 years ago

We intentionally don't expose jQuery deferreds because amplify does not have a hard dependency on jQuery. You can wrap the requests in deferreds on your own if you want: https://gist.github.com/2424902