@quenty/binder 8.16.0 → 9.0.0-canary.ff9fb44.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 +8 -0
- package/package.json +11 -11
- package/src/Shared/Binder.lua +23 -13
- package/src/Shared/BinderProvider.lua +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
# [9.0.0-canary.ff9fb44.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.16.0...@quenty/binder@9.0.0-canary.ff9fb44.0) (2023-06-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/binder
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [8.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.15.0...@quenty/binder@8.16.0) (2023-05-26)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/binder
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/binder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-canary.ff9fb44.0",
|
|
4
4
|
"description": "Utility object to Bind a class to Roblox object, and associated helper methods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "
|
|
29
|
-
"@quenty/brio": "
|
|
30
|
-
"@quenty/instanceutils": "
|
|
31
|
-
"@quenty/linkutils": "
|
|
32
|
-
"@quenty/loader": "
|
|
33
|
-
"@quenty/maid": "
|
|
34
|
-
"@quenty/promise": "
|
|
35
|
-
"@quenty/signal": "
|
|
36
|
-
"@quenty/valueobject": "
|
|
28
|
+
"@quenty/baseobject": "6.2.1",
|
|
29
|
+
"@quenty/brio": "8.13.0",
|
|
30
|
+
"@quenty/instanceutils": "7.14.0",
|
|
31
|
+
"@quenty/linkutils": "7.14.0",
|
|
32
|
+
"@quenty/loader": "6.2.1",
|
|
33
|
+
"@quenty/maid": "2.5.0",
|
|
34
|
+
"@quenty/promise": "6.5.0",
|
|
35
|
+
"@quenty/signal": "2.4.0",
|
|
36
|
+
"@quenty/valueobject": "7.14.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "ff9fb44bc6867fe6ac15ea58a744a028212c8601"
|
|
42
42
|
}
|
package/src/Shared/Binder.lua
CHANGED
|
@@ -67,20 +67,10 @@ Binder.ClassName = "Binder"
|
|
|
67
67
|
function Binder.new(tagName, constructor, ...)
|
|
68
68
|
local self = setmetatable({}, Binder)
|
|
69
69
|
|
|
70
|
-
self.
|
|
71
|
-
self.
|
|
72
|
-
self._constructor = constructor or error("Bad argument 'constructor', expected table or function")
|
|
73
|
-
|
|
74
|
-
self._instToClass = {} -- [inst] = class
|
|
75
|
-
self._allClassSet = {} -- [class] = true
|
|
76
|
-
self._pendingInstSet = {} -- [inst] = true
|
|
77
|
-
|
|
78
|
-
self._listeners = {} -- [inst] = callback
|
|
79
|
-
self._args = {...}
|
|
70
|
+
self._tagName = assert(tagName, "Bad argument 'tagName', expected string")
|
|
71
|
+
self._constructor = assert(constructor, "Bad argument 'constructor', expected table or function")
|
|
80
72
|
|
|
81
|
-
self
|
|
82
|
-
warn(("Binder %q is not loaded. Call :Start() on it!"):format(self._tagName))
|
|
83
|
-
end)
|
|
73
|
+
self:Init(...)
|
|
84
74
|
|
|
85
75
|
return self
|
|
86
76
|
end
|
|
@@ -111,6 +101,26 @@ function Binder.isBinder(value)
|
|
|
111
101
|
and type(value.Destroy) == "function"
|
|
112
102
|
end
|
|
113
103
|
|
|
104
|
+
--[=[
|
|
105
|
+
Initializes the Binder. Designed to be done via ServiceBag.
|
|
106
|
+
|
|
107
|
+
@param ... any
|
|
108
|
+
]=]
|
|
109
|
+
function Binder:Init(...)
|
|
110
|
+
self._maid = Maid.new()
|
|
111
|
+
|
|
112
|
+
self._instToClass = {} -- [inst] = class
|
|
113
|
+
self._allClassSet = {} -- [class] = true
|
|
114
|
+
self._pendingInstSet = {} -- [inst] = true
|
|
115
|
+
|
|
116
|
+
self._listeners = {} -- [inst] = callback
|
|
117
|
+
self._args = {...}
|
|
118
|
+
|
|
119
|
+
self._maid._warning = task.delay(5, function()
|
|
120
|
+
warn(("Binder %q is not loaded. Call :Start() on it!"):format(self._tagName))
|
|
121
|
+
end)
|
|
122
|
+
end
|
|
123
|
+
|
|
114
124
|
--[=[
|
|
115
125
|
Listens for new instances and connects to the GetInstanceAddedSignal() and removed signal!
|
|
116
126
|
]=]
|