Chemical reactions in microdroplets and microbubbles. Thermodynamic approach