How to spy the subscription state when using useSubscription?


I am currently using the same useSubscription(...) in two different React components, which mount and unmount independently. I suspect that one component may be canceling the subscription of the other upon unmounting.

To better debug this issue, I was wondering if there were any possibility to log a message when a subscribe event is completed and when an unsubscribe event is triggered? I have tried to use the useSubscription options parameter onComplete: () => {console.log("subscription completed");} but it doesn’t look to be working ; although the subscription seems to work, nothing is being logged in the console.

Alternatively, is there any Chrome dev tool that I could use to spy on the subscriptions? Unfortunately, the ones I have do not provide this feature.

Thank you for your help!