You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question on what's the best way for me to write an API that is compatible with promisifyAll.
At the moment it is written in this style
functionAPI(){this.do=function(arg1,cb){// do thingscb(null,res)}this.nested.do=function(arg2,cb){// do thingscb(null,res)}}// usagevarapi=newAPI()api.do('hello',function(err,res){...})api.nested.do('world',function(err,res){...})
Now this does not work with promisifyAll and I understand why (not using prototype, nested objects). But even if I change it to use API.prototype to assign the methods I still can't get the api.nested.do to be promisifed. Any ideas on how to solve this?
The text was updated successfully, but these errors were encountered:
You need to call promisifyAll on the nested object too. Also this issue tracker is only for bug reports or feature requests, questions about usage should be in stack overflow or the mailing list.
I have a question on what's the best way for me to write an API that is compatible with
promisifyAll
.At the moment it is written in this style
Now this does not work with
promisifyAll
and I understand why (not using prototype, nested objects). But even if I change it to useAPI.prototype
to assign the methods I still can't get theapi.nested.do
to be promisifed. Any ideas on how to solve this?The text was updated successfully, but these errors were encountered: