I am watching a video about RxJS and have come across some TypeScript syntax I've not seen before. It doesn't matter that it's RxJS, it's a generic question, but I thought I'd just add that it was RxJS.
It's the call to super()
in this that I don't understand:
class MyObservable extends Rx.Observable {
constructor(initialValue) {
super(observer) => {
observer.next(initialValue);
this.observer = observer;
}
}
}
The video goes on to point out that this is not a good way to extend observable functionality, but that's not what I'm interested in anyway. I'm interested in the call to super()
: what's going on here? The best that I can come up with is that it is shadowing the base class's constructor, but I'm not sure. Can anyone elucidate?