I made a small javascript infrastructure designed to add some useful material to a prototyped object model (calling a super method, inheritance, auto init ...).
In this structure, some object methods automatically call, for example, "init" to create the object and "destroy" when the window is unloaded.
I have two questions about this destruction method:
- What is this method used for?
I think it should do some cleanup on DOM objects (unbind events), but is there another cleanup?
- Should this method be called on another event? Is it possible to detect when an object is destroyed and call this method at this time?
If anyone is interested in this structure, I posted it on gitHub, but right now there is no documentation: - /:
https://github.com/LeMisterV/EasyPrototype
source
share