I think the employer can fire you on spot if you give him the letter. Since you give him the letter, you already determine to leave the company already and if the employer does not care if anyone can fill your shoes in the company, he can let you go right away.