I've just learned about memory leak of the RxJS Object. So I created a small code to test if it ok when I unsubscribe the Subject. Here is my code:
let subj = new rxjs.Subject();
const sub1 = subj.subscribe(text => console.log(text));
subj.next('subject 1');
subj.unsubscribe();
subj = new rxjs.Subject();
const sub2 = subj.subscribe(text => console.log(text));
subj.next('subject 2');
subj.unsubscribe();
In Chrome's devtool, I find out that the Rx objects can be seen in the Heap snapshot. Please explain to me why, and is it ok in term of memory leak?