mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Fixed definition for Rx.config.Promise;
Added test for promises;
This commit is contained in:
@@ -66,8 +66,12 @@ module Rx.Tests.Async {
|
||||
new<T>(resolver: (resolvePromise: (value: T)=> void, rejectPromise: (reason: any)=> void)=> void): Rx.IPromise<T>;
|
||||
};
|
||||
|
||||
Rx.config.Promise = promiseImpl;
|
||||
|
||||
var p: IPromise<number> = obsNum.toPromise(promiseImpl);
|
||||
|
||||
p = obsNum.toPromise();
|
||||
|
||||
p = p.then(x=> x);
|
||||
p = p.then(x=> p);
|
||||
p = p.then(undefined, reason=> 10);
|
||||
|
||||
Vendored
+1
-1
@@ -47,7 +47,7 @@ declare module Rx {
|
||||
}
|
||||
|
||||
export module config {
|
||||
export var Promise: { new <T>(resolve: (value: T) => void, reject: (reason: any) => void): IPromise<T>; };
|
||||
export var Promise: { new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise<T>; };
|
||||
}
|
||||
|
||||
export interface IDisposable {
|
||||
|
||||
Reference in New Issue
Block a user