@quenty/maid 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE.md +1 -1
- package/package.json +2 -2
- package/src/Shared/Maid.lua +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/maid@2.5.0...@quenty/maid@2.6.0) (2023-08-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add Maid:Add() which returns the task you pass into the maid ([bf9e3d6](https://github.com/Quenty/NevermoreEngine/commit/bf9e3d66e5c31ec0dafcc1c9e4142d963d309c65))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [2.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/maid@2.4.0...@quenty/maid@2.5.0) (2023-03-05)
|
|
7
18
|
|
|
8
19
|
|
package/LICENSE.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/maid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Easily cleanup event listeners and objects in Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "2547e660a0333034a5b20ddd6b23e343bc01f7c6"
|
|
33
33
|
}
|
package/src/Shared/Maid.lua
CHANGED
|
@@ -135,6 +135,26 @@ function Maid:__newindex(index, newTask)
|
|
|
135
135
|
end
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
--[=[
|
|
139
|
+
Gives a task to the maid for cleanup and returnsthe resulting value
|
|
140
|
+
|
|
141
|
+
@param task MaidTask -- An item to clean
|
|
142
|
+
@return MaidTask
|
|
143
|
+
]=]
|
|
144
|
+
function Maid:Add(task)
|
|
145
|
+
if not task then
|
|
146
|
+
error("Task cannot be false or nil", 2)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
self[#self._tasks+1] = task
|
|
150
|
+
|
|
151
|
+
if type(task) == "table" and (not task.Destroy) then
|
|
152
|
+
warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
return task
|
|
156
|
+
end
|
|
157
|
+
|
|
138
158
|
--[=[
|
|
139
159
|
Gives a task to the maid for cleanup, but uses an incremented number as a key.
|
|
140
160
|
|