@rbxts/trash
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

@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 cleaning

All 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;

Package Sidebar

Install

npm i @rbxts/trash

Weekly Downloads

101

Version

1.0.8

License

ISC

Unpacked Size

9.27 kB

Total Files

4

Last publish

Collaborators

  • runicly