My monitorSubscriberCount operator merely calls back the specified method whenever a subscription is added/removed. What I find weird about this though is that I have had to add .distinctUntilChanged in order to make it work. Without it, it seems the .map operator is not remapping the source data into the target.
To see this problem in action clone https://github.com/mrpmorris/rxjs-garbage-collect and then type "ng test" in a command prompt. Note how everything works fine, but then removing the .distinctUntilChanged line in /src/rxjs-garbage-collect/src/selectors/StateSelector.ts breaks everything.
I'm hoping someone can explain something to me. In this file -> https://github.com/mrpmorris/rxjs-garbage-collect/blob/master/src/rxjs-garbage-collect/src/selectors/StateSelector.ts
...there is a chunk of code that looks like this
My monitorSubscriberCount operator merely calls back the specified method whenever a subscription is added/removed. What I find weird about this though is that I have had to add .distinctUntilChanged in order to make it work. Without it, it seems the .map operator is not remapping the source data into the target.
To see this problem in action clone https://github.com/mrpmorris/rxjs-garbage-collect and then type "ng test" in a command prompt. Note how everything works fine, but then removing the .distinctUntilChanged line in /src/rxjs-garbage-collect/src/selectors/StateSelector.ts breaks everything.