Scary moment!

So I just formula fed my newborn who is being primarily breastfed (my boobs ran out of milk). I burped her and I waited about 30min post feeding to swaddle her and lay her down. As I'm getting ready for bed I her a sloshing noise. I go to check on my LO and she has thrown up in her sleep but was now choking on her own vomit. Scared the crap out of me!!!!

Any way to avoid this in the future?? I am almost too scared to lay her back down.