Updating Promise methods to use correct parameters

This commit is contained in:
Lindsay Evans 2015-07-06 10:27:30 +10:00
parent 045d13a1f8
commit 7c3fbd6945
2 changed files with 8 additions and 4 deletions

View File

@ -75,4 +75,8 @@ qwest.get('foo', null, {
timeout: 2000,
attempts: 7
})
qwest.get('foo', null, {})
qwest.get('foo', null, {})
qwest.get('foo', null, {}).complete(() => {
//done
})

6
qwest/qwest.d.ts vendored
View File

@ -58,13 +58,13 @@ declare module Qwest {
interface Promise {
/** Request is successful */
then(callback: (xhr: XMLHttpRequest, response: any) => any): Promise;
then(callback: (response: any) => any): Promise;
/** Request has failed */
catch(callback: (xhr: XMLHttpRequest, response: any) => any): Promise;
catch(callback: (e: any, response: any) => any): Promise;
/** Always run */
complete(callback: (response: any) => any): Promise;
complete(callback: () => any): Promise;
}
interface Options {