[20190807] promise callback function with the wording

 Callback wording:

asyncFunction1(callback){
    // ...
    asyncFunction2(callback){
        // ...
        asuncFunction3(callback){
            // ...
        }
    }
}

 

promise wording 

promise1
.then(
    // ...
    return promise2
)
.then(
    // ..
    return promise3
)
.then(
    // ..
)

 or

Promise.all([promise1,promise2,promise3])
.then(
    // ...
)

 

Guess you like

Origin www.cnblogs.com/jimfigo/p/11316714.html
Recommended