import { Observable } from 'rxjs'; export const isPromise = (obj: any): obj is Promise => !!obj && typeof obj.then === 'function'; export const isObservable = (obj: any | Observable): obj is Observable => !!obj && typeof obj.subscribe === 'function';