@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 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": "8.16.0",
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": "^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"
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": "11058e90e51ea83d3dad6ae9abe59cc19c36b94b"
41
+ "gitHead": "ff9fb44bc6867fe6ac15ea58a744a028212c8601"
42
42
  }
@@ -67,20 +67,10 @@ Binder.ClassName = "Binder"
67
67
  function Binder.new(tagName, constructor, ...)
68
68
  local self = setmetatable({}, Binder)
69
69
 
70
- self._maid = Maid.new()
71
- self._tagName = tagName or error("Bad argument 'tagName', expected string")
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._maid._warning = task.delay(5, function()
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
  ]=]
@@ -117,6 +117,10 @@ function BinderProvider:Init(...)
117
117
 
118
118
  self._initMethod(self, ...)
119
119
 
120
+ for _, binder in pairs(self._binders) do
121
+ binder:Init(...)
122
+ end
123
+
120
124
  self._bindersAddedPromise:Resolve()
121
125
  end
122
126