When I am in the editor writing an answer to a question, the system will notify me (in real time!) when another answer has been posted. This is presumably so I can see if the new answer may have rendered my post somewhat redundant.
Can we extend that same feature/courtesy to authors when a question is being voted to close?
[example notice]
The question you are answering has recently received vote(s) to be closed by the community. Please click to refresh this page to see if closure is likely, or if you can post your answer to another thread asking this question.
The notice can be more specific depending on the type of closure. It might even be prudent to include this warning whenever someone starts to answer a question with (even preexisting) close votes.
It's not reasonable to expect folks everywhere to have an innate understanding of when a post might not be the best fit for a site. This is an opportunity to head off an unfortunate situation and turn it into a bit of just-in-time learning rather than enabling a lot of unwanted content.