What is the best way to handle situations when a function does not always return a promise? My actual code is too complicated to explain but the essence of the problem boils down to checking a condition and depending on it I either return a local variable or need to send an ajax request. Something like this:What is the best way to handle situations when