Smart contract that atomically executes an action after receiving ERC-20 funds (not ETH)

Hello,
I am interested in developing a smart contract that can receive funds in the form of an ERC20 stable coin and atomically, after receiving the funds execute some action, like making a transaction call to another contract. Can anyone give me ideas of how to efficiently go about it?

This might give you a clue.