THREE Object Janitor
A janitor is a utility class that can be used to clean up resources, especially GPU allocated ones, that are no longer needed by your program.
I found this particularly useful when I have multiple complex scenes and the user is able to go back and forth and music has to stop and things need to unload etc. This simply helps me track all that.
const myObject = new THREE.Mesh(...); // track an Object3D janitor.mop(myObject); // later on, dispose everything you have tracked // Object3D disposal includes geometries, textures, materials janitor.dispose();
Works with other object types as well not just Object3D derived.