I use
javascript library that has
api.
libapi.callnetwork(arg1,callback(data){
//handle
data
}
then
i create service function to call api like
this
myFunction():Promise{
libapi.callnetwork(arg1,callback(data){
return new
Promise(resolve=>resolve(data));
})
}
myFunction
will get error because it must return promise or declare as void. How can i create
function that return promise from this api?
No comments:
Post a Comment