pikaso
pikaso copied to clipboard
Add destroy method to Pikaso instance
Is your feature request related to a problem? Please describe. Need a way to destroy the Pikaso instance so that it no longer listens for events or any adjacent code
Describe the solution you'd like In the main instance add a method called destroy similar to the one in KonvaJS
class Pikaso {
constructor(config) {
// constructor implementation
}
// other methods implementation
destroy() {
// stop listening to events
this.off();
// other cleanup operations
// ...
// set instance properties to null to aid garbage collection
for (let prop in this) {
if (this.hasOwnProperty(prop)) {
this[prop] = null;
}
}
}
}