7 ms·
It would also really help if you were verbose in the naming of your methods as to weather they were async or not. At first I didn't realise db.remove() was asyn
by robmcm 11y ago
It would also really help if you were verbose in the naming of your methods as to weather they were async or not. At first I didn't realise db.remove() was async (sorry perhaps that's my fault).
Also on your timing diagrams it may be worth indicating that methods don't start executing at the exact same time due to the single thread:
doSomething().then(function () {
doSomethingElse();
}).then(finalHandler);
doSomething
|-----------------|
doSomethingElse(undefined)
..................|------------------|
finalHandler(undefined)
....................|------------------|
It's my understanding that the finally handler can not execute before the body of doSomethingElse has run. (Although I am unsure of a pretty/clear way to add this to a diagram ;) )