TypeScript and void Q promises -


what correct way use q promises typescript 1.6 if void? is, don't represent value. example:

return q.promise<void>((resolve,reject) => {     resolve(); } 

or

let deferred = q.defer<void>(); deferred.resolve(); return deferred.promise; 

the call resolve() gets error:

supplied parameters not match signature of call target (parameter) resolve: (val: void | q.ipromise<void>) => void 

note, following works:

let deferred = q.defer<string>(); deferred.resolve("hello world"); return deferred.promise; 

is bug in definitelytyped typing (updated aug 17, 2015 of writing) perhaps, or specifying wrong?

if there no return value or not care return value, have been using...

return q.promise<any>((resolve, reject) => {   resolve(); } 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -