@quenty/binder 8.1.1 → 8.2.0-canary.d601d03.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 +11 -11
- package/src/Shared/BinderProvider.lua +15 -2
- package/src/Shared/BinderProvider.spec.lua +1 -1
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.2.0-canary.d601d03.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.1.1...@quenty/binder@8.2.0-canary.d601d03.0) (2022-11-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Binder provider now provides name for debugging ([72d547e](https://github.com/Quenty/NevermoreEngine/commit/72d547ea47358dfab1128dd076723f5a1a0d9fd8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/binder@8.1.0...@quenty/binder@8.1.1) (2022-11-04)
|
|
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.2.0-canary.d601d03.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.0.1",
|
|
29
|
+
"@quenty/brio": "8.1.1",
|
|
30
|
+
"@quenty/instanceutils": "7.1.1",
|
|
31
|
+
"@quenty/linkutils": "7.1.1",
|
|
32
|
+
"@quenty/loader": "6.0.1",
|
|
33
|
+
"@quenty/maid": "2.4.0",
|
|
34
|
+
"@quenty/promise": "6.0.1",
|
|
35
|
+
"@quenty/signal": "2.3.0",
|
|
36
|
+
"@quenty/valueobject": "7.1.1"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "d601d0346a3aa2d3cf2b3e0ed54d0dbc062b9a87"
|
|
42
42
|
}
|
|
@@ -20,7 +20,7 @@ BinderProvider.__index = BinderProvider
|
|
|
20
20
|
local serviceBag = ServiceBag.new()
|
|
21
21
|
|
|
22
22
|
-- Usually in a separate file!
|
|
23
|
-
local binderProvider = BinderProvider.new(function(self, serviceBag)
|
|
23
|
+
local binderProvider = BinderProvider.new("BirdBinders", function(self, serviceBag)
|
|
24
24
|
serviceBag:Add(Binder.new("Bird", require("Bird")))
|
|
25
25
|
end)
|
|
26
26
|
|
|
@@ -32,12 +32,25 @@ BinderProvider.__index = BinderProvider
|
|
|
32
32
|
serviceBag:Start()
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
@param serviceName string -- Name of the service (used for memory tracking)
|
|
35
36
|
@param initMethod (self, serviceBag: ServiceBag)
|
|
36
37
|
@return BinderProvider
|
|
37
38
|
]=]
|
|
38
|
-
function BinderProvider.new(initMethod)
|
|
39
|
+
function BinderProvider.new(serviceName, initMethod)
|
|
39
40
|
local self = setmetatable({}, BinderProvider)
|
|
40
41
|
|
|
42
|
+
if type(serviceName) == "string" then
|
|
43
|
+
self.ServiceName = serviceName
|
|
44
|
+
else
|
|
45
|
+
-- Backwords compatibility (for now)
|
|
46
|
+
if type(serviceName) == "function" and initMethod == nil then
|
|
47
|
+
warn("[BinderProvider] - Missing serviceName for binder provider. Please pass in a service name as the first argument.")
|
|
48
|
+
initMethod = serviceName
|
|
49
|
+
else
|
|
50
|
+
error("Bad serviceName")
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
41
54
|
self._initMethod = initMethod or error("No initMethod")
|
|
42
55
|
self._initialized = false
|
|
43
56
|
self._started = false
|
|
@@ -13,7 +13,7 @@ return function()
|
|
|
13
13
|
local initialized = false
|
|
14
14
|
|
|
15
15
|
it("should execute immediately", function()
|
|
16
|
-
provider = BinderProvider.new(function(self, arg)
|
|
16
|
+
provider = BinderProvider.new("BinderServiceName", function(self, arg)
|
|
17
17
|
initialized = true
|
|
18
18
|
assert(arg == 12345, "Bad arg")
|
|
19
19
|
|