@quenty/boundlinkutils 7.1.0 → 7.1.1-canary.288.c2f64f9.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 +8 -8
- package/src/Shared/BoundLinkUtils.lua +36 -1
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
|
+
## [7.1.1-canary.288.c2f64f9.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/boundlinkutils@7.1.0...@quenty/boundlinkutils@7.1.1-canary.288.c2f64f9.0) (2022-09-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/boundlinkutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [7.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/boundlinkutils@7.0.1...@quenty/boundlinkutils@7.1.0) (2022-08-22)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/boundlinkutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/boundlinkutils",
|
|
3
|
-
"version": "7.1.0",
|
|
3
|
+
"version": "7.1.1-canary.288.c2f64f9.0",
|
|
4
4
|
"description": "Utility functions involving binders and links",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/binder": "
|
|
29
|
-
"@quenty/linkutils": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/maid": "
|
|
32
|
-
"@quenty/promise": "
|
|
33
|
-
"@quenty/signal": "
|
|
28
|
+
"@quenty/binder": "7.1.1-canary.288.c2f64f9.0",
|
|
29
|
+
"@quenty/linkutils": "6.1.1-canary.288.c2f64f9.0",
|
|
30
|
+
"@quenty/loader": "5.0.2-canary.288.c2f64f9.0",
|
|
31
|
+
"@quenty/maid": "2.4.0",
|
|
32
|
+
"@quenty/promise": "5.1.2-canary.288.c2f64f9.0",
|
|
33
|
+
"@quenty/signal": "2.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c2f64f9bb90b0e5f0e4f4bc04a58af852bac6460"
|
|
39
39
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
--[=[
|
|
2
|
-
Utility functions involving binders and links
|
|
2
|
+
Utility functions involving binders and links. It's a common pattern to link
|
|
3
|
+
back to a bound class. This allows you to quickly retrieve these objects.
|
|
4
|
+
|
|
3
5
|
@class BoundLinkUtils
|
|
4
6
|
]=]
|
|
5
7
|
|
|
@@ -12,6 +14,14 @@ local BinderUtils = require("BinderUtils")
|
|
|
12
14
|
|
|
13
15
|
local BoundLinkUtils = {}
|
|
14
16
|
|
|
17
|
+
--[=[
|
|
18
|
+
Gets a linked object from the current instance.
|
|
19
|
+
|
|
20
|
+
@param binder Binder<T>
|
|
21
|
+
@param linkName string
|
|
22
|
+
@param from Instance
|
|
23
|
+
@return T?
|
|
24
|
+
]=]
|
|
15
25
|
function BoundLinkUtils.getLinkClass(binder, linkName, from)
|
|
16
26
|
assert(type(binder) == "table", "Bad binder")
|
|
17
27
|
assert(type(linkName) == "string", "Bad linkName")
|
|
@@ -25,6 +35,14 @@ function BoundLinkUtils.getLinkClass(binder, linkName, from)
|
|
|
25
35
|
return binder:Get(linkValue)
|
|
26
36
|
end
|
|
27
37
|
|
|
38
|
+
--[=[
|
|
39
|
+
Gets a linked objects from the current instance.
|
|
40
|
+
|
|
41
|
+
@param binder Binder<T>
|
|
42
|
+
@param linkName string
|
|
43
|
+
@param from Instance
|
|
44
|
+
@return { T }
|
|
45
|
+
]=]
|
|
28
46
|
function BoundLinkUtils.getLinkClasses(binder, linkName, from)
|
|
29
47
|
assert(type(binder) == "table", "Bad binder")
|
|
30
48
|
assert(type(linkName) == "string", "Bad linkName")
|
|
@@ -40,6 +58,14 @@ function BoundLinkUtils.getLinkClasses(binder, linkName, from)
|
|
|
40
58
|
return classes
|
|
41
59
|
end
|
|
42
60
|
|
|
61
|
+
--[=[
|
|
62
|
+
Gets a linked objects from the current instance.
|
|
63
|
+
|
|
64
|
+
@param binders { Binder<T> }
|
|
65
|
+
@param linkName string
|
|
66
|
+
@param from Instance
|
|
67
|
+
@return { T }
|
|
68
|
+
]=]
|
|
43
69
|
function BoundLinkUtils.getClassesForLinkValues(binders, linkName, from)
|
|
44
70
|
assert(type(binders) == "table", "Bad binders")
|
|
45
71
|
assert(type(linkName) == "string", "Bad linkName")
|
|
@@ -67,6 +93,15 @@ function BoundLinkUtils.getClassesForLinkValues(binders, linkName, from)
|
|
|
67
93
|
return classes
|
|
68
94
|
end
|
|
69
95
|
|
|
96
|
+
--[=[
|
|
97
|
+
Calls a method on the binders
|
|
98
|
+
|
|
99
|
+
@param binders { Binder<T> }
|
|
100
|
+
@param linkName string
|
|
101
|
+
@param from Instance
|
|
102
|
+
@param methodName string
|
|
103
|
+
@param args {}
|
|
104
|
+
]=]
|
|
70
105
|
function BoundLinkUtils.callMethodOnLinkedClasses(binders, linkName, from, methodName, args)
|
|
71
106
|
assert(type(binders) == "table", "Bad arg 'binders'")
|
|
72
107
|
assert(type(linkName) == "string", "Bad arg 'linkName'")
|