aircall / aircall-everywhere

SDK to embed and communicate to Aircall phone in any web page
https://aircall.github.io/aircall-everywhere
25 stars 16 forks source link

No API to clean up aircall client/event listeners #22

Open bent0b0x opened 3 years ago

bent0b0x commented 3 years ago

The AircallPhone class adds event listeners to the window object (this.w) upon instantiation here.

However, as far as I can tell there is no way to clean up this listener (and any other side effect that instantiation may cause). Thus, once you load the aircall iframe in your app there is no true way to do a full cleanup once the call flow is over.

It would be great to have some sort of .destroy() method to clean up the client.

Thank you in advance for taking a look!