Merge pull request #11667 from eric-wieser/q-fixes

Add argumentless Q()
This commit is contained in:
John Reilly
2016-10-02 18:56:41 +01:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@
import q = require('q');
Q(8).then(x => console.log(x.toExponential()));
Q().then(() => console.log("nothing"));
var delay = function (delay: number) {
var d = Q.defer<void>();
Vendored
+4
View File
@@ -12,6 +12,10 @@ declare function Q<T>(promise: Q.IPromise<T>): Q.Promise<T>;
* If value is not a promise, returns a promise that is fulfilled with value.
*/
declare function Q<T>(value: T): Q.Promise<T>;
/**
* Calling with nothing at all creates a void promise
*/
declare function Q(): Q.Promise<void>;
declare namespace Q {
interface IPromise<T> {