From 55c35bf01e8e1d1e0b81711583d4bf568431ea21 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 2 Oct 2016 01:03:02 +0100 Subject: [PATCH] Add argumentless Q() --- q/Q-tests.ts | 1 + q/Q.d.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index e59f2dc1b3..eaa1241016 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -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(); diff --git a/q/Q.d.ts b/q/Q.d.ts index 1fa4642121..55ac3df6a1 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -12,6 +12,10 @@ declare function Q(promise: Q.IPromise): Q.Promise; * If value is not a promise, returns a promise that is fulfilled with value. */ declare function Q(value: T): Q.Promise; +/** + * Calling with nothing at all creates a void promise + */ +declare function Q(): Q.Promise; declare namespace Q { interface IPromise {