Skip to content

Commit abc2eff

Browse files
committed
descs
1 parent 38d1978 commit abc2eff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Features/Cleanup/Janitor.lua

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
33
-- If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

5+
--- @class Janitor
6+
57
local RunService = game:GetService("RunService")
68

79
local Janitor = {}
@@ -31,6 +33,7 @@ function Janitor.isJanitor(value: table?)
3133
return type(value) == "table" and value.ClassName == "Janitor"
3234
end
3335

36+
--- This function is used to create a new Janitor instance and assign to it an object.
3437
function Janitor:Give(task: any)
3538
local function handleTask(subtask: any)
3639
assert(typeof(task) ~= "boolean", "Task cannot be a boolean")
@@ -55,6 +58,7 @@ function Janitor:Give(task: any)
5558
return handleTask(task)
5659
end
5760

61+
--- This function is used to cleanup an object assigned to a currently running Janitor instance.
5862
function Janitor:Cleanup(taskTable: table?)
5963
local tasks = taskTable or self._tasks
6064

@@ -87,6 +91,7 @@ function Janitor:Cleanup(taskTable: table?)
8791
end
8892
end
8993

94+
--- This function is used to destroy (basically delete) any Janitor instances currently running.
9095
function Janitor:Destroy()
9196
self:Cleanup()
9297

0 commit comments

Comments
 (0)