I have a function A which performs some processing
A().then({
check if error saveStatus(failure)
if not then saveStatus(Success)
});
I want to add a timeout for the above function, so that if it has written status then it should be timed out else if success/failure none is written to DB further action can be taken.
Is there any way I can know that function A processing saveStatus() and cancel the timeout at the same instant?