Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/trash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@rbxts/trash
just another janitor clone
class Balls {
public destroy(): void {
print("destroyed balls")
}
}
const part = Workspace.WaitForChild("Part");
const balls = new Balls;
const trash1 = new Trash;
const trash = trash1.add(new Trash);
trash.add(part); // track items to clean
trash.add(balls);
trash.add(() => print("took out trash")); // called when trash is purged
trash.purge(); // cleans
trash.destroy(); // cleans & renders class useless
trash.removeAll(); //s remove all items without cleaningAll overloads for Trash.add()
public add<Name extends keyof T, T extends { [K in Name]: Callback; }>(obj: T, methodName: Name): T;
public add<T extends RobloxDestroyable>(destroyable: T): T;
public add<T extends CustomDestroyable>(destroyable: T): T;
public add<T extends CustomSignal>(signal: T): T;
public add<T extends BaseSignalConnection>(connection: T): T;
public add<T extends Promise<unknown>>(promise: T): T;
public add(thread: thread): thread;
public add(onCleanup: Callback): void;