I started a front-end developer position with a company (Company A) about two weeks ago. Briefly, it's fine, I don't love it, and was never planning on staying for more than a year or two.
Out of the blue, a company (Company B) that I applied for a position with months before I accepted the position with Company A reached out to do an interview and some technical assessments. During the interview, we discussed why there was a 4 month gap between applying and getting an interview, everything seems fine, and long story short, they offered me a position with literally double the salary I'm being paid at Company A. On top of that, the work at Company B is so much more in alignment with my interests and long-term goals, so there really isn't much decision to consider here; I'm absolutely accepting the offer.
My question is: what is the most gracious way to resign from Company A? I'd almost never apply for a role immediately after accepting one, and even though I applied to Company B first, I know the optics aren't good for me. Should I bother putting in a two weeks notice? I'm on a team with a few other developers at Company A and work at the moment is so slow that I've gone through some days without looking at a single line of code. I'm obviously not concerned with listing the short time on my resume or asking for a reference, but I'm just wondering how to make my way out the door while saving as much face as possible.