If Maggie May is actually vomiting or gagging up white foam, then I have several thoughts as to what might be going on:
1. She may be feeling a residual nausea from whatever caused her loose stools from a few days ago.
2. She might have ingested something with a foul taste
3. Yorkies don't tend to chew on things such as grass or sticks which can irritate the back of the throat, but I'll include it to be complete.
Regardless, the following would be my suggestions for her:
1. I'd give her over the counter Pepcid AC which may help to settle her stomach. The does for a dog this size would be about 1/8th of a 10 mg tablet twice a day...clearly a very small amount at one time.
2. I'd withhold food for about 8-12 hours and give everything a chance to settle down. I always worry about low blood sugar in these small breeds when they don't eat so I'd rub a small amount of honey or pancake syrup on her gums (if she won't eat it) every several hours to keep her blood sugar levels high.
3. If she doesn't seem to be as nauseous, then I'd offer her a very small amount of boiled, skinless, boneless chicken breast and 20-minute white rice but only a very small amount at one time. I wouldn't feed her any of her regular food.
Hopefully, the above will be sufficient to resolve the problem. Deb