@quenty/binder 8.20.0 → 8.21.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/package.json +7 -7
- package/src/Shared/Binder.lua +19 -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
|
+
# [8.21.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.20.0...@quenty/binder@8.21.0) (2023-07-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add Binder:Create() API surface ([0e78a1c](https://github.com/Quenty/NevermoreEngine/commit/0e78a1ce69e2469f61059b641b2000ddd0c7d758))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [8.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.19.1...@quenty/binder@8.20.0) (2023-07-10)
|
|
7
18
|
|
|
8
19
|
**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": "8.
|
|
3
|
+
"version": "8.21.0",
|
|
4
4
|
"description": "Utility object to Bind a class to Roblox object, and associated helper methods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@quenty/baseobject": "^6.2.1",
|
|
29
|
-
"@quenty/brio": "^8.
|
|
30
|
-
"@quenty/instanceutils": "^7.
|
|
31
|
-
"@quenty/linkutils": "^7.
|
|
29
|
+
"@quenty/brio": "^8.15.0",
|
|
30
|
+
"@quenty/instanceutils": "^7.17.0",
|
|
31
|
+
"@quenty/linkutils": "^7.17.0",
|
|
32
32
|
"@quenty/loader": "^6.2.1",
|
|
33
33
|
"@quenty/maid": "^2.5.0",
|
|
34
34
|
"@quenty/promise": "^6.6.0",
|
|
35
|
-
"@quenty/rx": "^7.
|
|
35
|
+
"@quenty/rx": "^7.13.0",
|
|
36
36
|
"@quenty/signal": "^2.4.0",
|
|
37
|
-
"@quenty/valueobject": "^7.
|
|
37
|
+
"@quenty/valueobject": "^7.18.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "af7a623f58fe7ec96b47c80e385b71f820fd4cb8"
|
|
43
43
|
}
|
package/src/Shared/Binder.lua
CHANGED
|
@@ -73,6 +73,7 @@ function Binder.new(tagName, constructor, ...)
|
|
|
73
73
|
|
|
74
74
|
self._tagName = assert(tagName, "Bad argument 'tagName', expected string")
|
|
75
75
|
self._constructor = assert(constructor, "Bad argument 'constructor', expected table or function")
|
|
76
|
+
self._defaultClassType = "Folder"
|
|
76
77
|
self.ServiceName = self._tagName .. "Binder"
|
|
77
78
|
|
|
78
79
|
if select("#", ...) > 0 then
|
|
@@ -507,6 +508,24 @@ function Binder:Promise(inst, cancelToken)
|
|
|
507
508
|
return promiseBoundClass(self, inst, cancelToken)
|
|
508
509
|
end
|
|
509
510
|
|
|
511
|
+
--[=[
|
|
512
|
+
Creates a new class tagged with this binder's instance
|
|
513
|
+
|
|
514
|
+
@param className string | nil
|
|
515
|
+
@return Instance
|
|
516
|
+
]=]
|
|
517
|
+
function Binder:Create(className)
|
|
518
|
+
assert(type(className) == "string" or className == nil, "Bad className")
|
|
519
|
+
|
|
520
|
+
local instance = Instance.new(className or self._defaultClassType)
|
|
521
|
+
instance.Name = self._tagName
|
|
522
|
+
instance.Archivable = false
|
|
523
|
+
|
|
524
|
+
self:Tag(instance)
|
|
525
|
+
|
|
526
|
+
return instance
|
|
527
|
+
end
|
|
528
|
+
|
|
510
529
|
function Binder:_add(inst)
|
|
511
530
|
assert(typeof(inst) == "Instance", "Argument 'inst' is not an Instance")
|
|
512
531
|
|