An open API service indexing awesome lists of open source software.

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

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