I have a function that can return 1 out of 3 possible types:
getFoo(): Observable<Foo> | Promise<Foo> | Foo {
//return 1 of 3 types
}
So how can I ensure the exact type after calling:
const foo = someClassObj.getFoo();
If I now want to get the data from foo, how can I know if it's Observable, Promise, or class instance Foo? When I try instanceof or typeof, they only detect 'object'.