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
function SyncFunction(){
var ret;
setTimeout(function(){
ret = "hello";
},3000);
// may be promise.then(res=>ret=res)
while(ret === undefined) {
require('deasync').sleep(100);
}
// returns hello with sleep; undefined without
return ret;
}
// may be promise.then(res=>ret=res)?
but it seems waste time to wait?
is there better method?
The text was updated successfully, but these errors were encountered:
function SyncFunction(){
var ret;
setTimeout(function(){
ret = "hello";
},3000);
// may be promise.then(res=>ret=res)
while(ret === undefined) {
require('deasync').sleep(100);
}
// returns hello with sleep; undefined without
return ret;
}
// may be promise.then(res=>ret=res)?
but it seems waste time to wait?
is there better method?
The text was updated successfully, but these errors were encountered: