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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -