API
Janitor
A small cleanup helper.
utility
A small cleanup helper. Pass instances, connections, or functions to Janitor:Add, then call Janitor:Destroy when the owner goes away.
Source
../examples/library/src/Janitor.luau:1
Properties
| Property | Type | Description | Source |
|---|---|---|---|
ClassName | string | Always "Janitor". | ../examples/library/src/Janitor.luau:12 |
Constructors
new
constructor
function Janitor.new(): JanitorReturns
Prop
Type
../examples/library/src/Janitor.luau:16
Methods
Add
function Janitor:Add(object: T, methodName: (boolean | string)?, index: any): TAdds an object to be cleaned up later.
Parameters
Prop
Type
Returns
Prop
Type
../examples/library/src/Janitor.luau:23
Destroy
function Janitor:Destroy()Cleans everything the janitor owns.
Errors
Prop
Type