javascript - How to make async wrap-function for async function? -
i have 'func1' wraps async 'func2' like:
func1 = function(arg1) { func2 (arg1, function(result) { // parse , return parts of 'result' }, function(error) { alert (error.message); }) }
how make 'func1' async (for external code).
function wrapper(callback) {//async callback standard libs func1(arg1);//call original func1 defined. callback(); //first arg error, second result (you don't have result empty) }
Comments
Post a Comment