rollbar / rollbar.js

Error tracking and logging from Javascript to Rollbar
https://docs.rollbar.com/docs/javascript
MIT License
571 stars 213 forks source link

Method to destroy Rollbar instance with removing all event listeners #1050

Open eemorozov opened 1 year ago

eemorozov commented 1 year ago

Hello. I use Rollbar along with @rollbar/react. My React apps have 2 types: containers and sub-applications. Containers dynamically load sub-applications. Each app has its own Rollbar project and therefore initialise separate Rollbar instance. There can be situation when I navigate across apps (new app loaded and mounted, old unmounted).

Then if in some app unhandledrejection event is happened, Rollbar send event log requests for all previously opened apps (even if they are already unmounted). The reason of that, I suppose, is here. We add global event listener and it's not removed.

Can we with some method totally destroy Rollbar instance (with ability to remove all event listeners)?