https://github.com/r-unic/trash
Roblox cleanup module
https://github.com/r-unic/trash
Last synced: 10 months ago
JSON representation
Roblox cleanup module
- Host: GitHub
- URL: https://github.com/r-unic/trash
- Owner: R-unic
- Created: 2025-06-23T15:26:43.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-01T13:31:53.000Z (about 1 year ago)
- Last Synced: 2025-09-06T14:49:55.549Z (10 months ago)
- Language: TypeScript
- Size: 20.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @rbxts/trash
just another janitor clone
```ts
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()`
```ts
public add(obj: T, methodName: Name): T;
public add(destroyable: T): T;
public add(destroyable: T): T;
public add(signal: T): T;
public add(connection: T): T;
public add>(promise: T): T;
public add(thread: thread): thread;
public add(onCleanup: Callback): void;
```