forked from vkurchatkin/deasync
-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
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?
Metadata
Metadata
Assignees
Labels
No labels