4 ms·
How do you make something idempotent if one of the effects is sending an email?
How do you make something idempotent if one of the effects is sending an email?
You can't make everything idempotent.
You should still try and make most things idempotent.
Side effects go to the border of the app. You keep track if for some message X you have sended the email, so you garantie that you send it once.