I've just had a question closed while I was composing a lengthy answer to it. This hasn't been the first time, and every time it happens I get the urge to trade in my keyboard for a machine gun and... well anyway, I get very upset.
If close-votes are coming in while I compose an answer, I want to know about it as they come in, not after the question has turned into a pumpkin.
There is a sort of "escrow" timer in place for answers in progress. If, while you are composing an answer, a question gets closed, generally you can complete your response within your open window, post the answer, and it will get incorporated into the question.