I have a variable which can have type of Date or BehaviorSubject<Date | null>. I wanna know how can i check if the variable is a BehaviorSubject or not?
If you do this in JavaScript you can do:
const behaviorSubject = new Rx.BehaviorSubject();
const isBehaviorSubject = behaviorSubject instanceof Rx.BehaviorSubject;
Did you try the following
class BehaviorSubject {}
let myVariable = new BehaviorSubject()
console.log(myVariable instanceof BehaviorSubject)