@quenty/valueobject 13.17.2 → 13.17.3-canary.550.afa1b3b.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 +9 -9
- package/src/Shared/ValueObject.lua +12 -9
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
|
+
## [13.17.3-canary.550.afa1b3b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.17.2...@quenty/valueobject@13.17.3-canary.550.afa1b3b.0) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/valueobject
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [13.17.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.17.0...@quenty/valueobject@13.17.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/valueobject",
|
|
3
|
-
"version": "13.17.
|
|
3
|
+
"version": "13.17.3-canary.550.afa1b3b.0",
|
|
4
4
|
"description": "To work like value objects in Roblox and track a single item with .Changed events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/brio": "
|
|
30
|
-
"@quenty/ducktype": "
|
|
31
|
-
"@quenty/loader": "
|
|
32
|
-
"@quenty/maid": "
|
|
33
|
-
"@quenty/rx": "
|
|
34
|
-
"@quenty/signal": "
|
|
35
|
-
"@quenty/valuebaseutils": "
|
|
29
|
+
"@quenty/brio": "14.17.3-canary.550.afa1b3b.0",
|
|
30
|
+
"@quenty/ducktype": "5.8.4-canary.550.afa1b3b.0",
|
|
31
|
+
"@quenty/loader": "10.8.3-canary.550.afa1b3b.0",
|
|
32
|
+
"@quenty/maid": "3.4.3-canary.550.afa1b3b.0",
|
|
33
|
+
"@quenty/rx": "13.17.3-canary.550.afa1b3b.0",
|
|
34
|
+
"@quenty/signal": "7.10.3-canary.550.afa1b3b.0",
|
|
35
|
+
"@quenty/valuebaseutils": "13.17.3-canary.550.afa1b3b.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "afa1b3b99b862698c3ab46009497bd507150867c"
|
|
41
41
|
}
|
|
@@ -50,7 +50,7 @@ export type ValueObject<T> = typeof(setmetatable(
|
|
|
50
50
|
_lastEventContext: { any }?,
|
|
51
51
|
_lastMountedSub: _Subscription.Subscription<(T, ...any)>?,
|
|
52
52
|
},
|
|
53
|
-
ValueObject
|
|
53
|
+
{} :: typeof({ __index = ValueObject })
|
|
54
54
|
))
|
|
55
55
|
|
|
56
56
|
--[=[
|
|
@@ -60,11 +60,14 @@ export type ValueObject<T> = typeof(setmetatable(
|
|
|
60
60
|
@return ValueObject
|
|
61
61
|
]=]
|
|
62
62
|
function ValueObject.new<T>(baseValue: T?, checkType: ValueObjectTypeArg?): ValueObject<T>
|
|
63
|
-
local self = setmetatable(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
local self: ValueObject<T> = setmetatable(
|
|
64
|
+
{
|
|
65
|
+
_value = baseValue,
|
|
66
|
+
_default = baseValue,
|
|
67
|
+
_checkType = checkType,
|
|
68
|
+
} :: any,
|
|
69
|
+
ValueObject
|
|
70
|
+
)
|
|
68
71
|
|
|
69
72
|
if type(checkType) == "string" then
|
|
70
73
|
if typeof(baseValue) ~= checkType then
|
|
@@ -74,7 +77,7 @@ function ValueObject.new<T>(baseValue: T?, checkType: ValueObjectTypeArg?): Valu
|
|
|
74
77
|
assert(checkType(baseValue))
|
|
75
78
|
end
|
|
76
79
|
|
|
77
|
-
return self
|
|
80
|
+
return self
|
|
78
81
|
end
|
|
79
82
|
|
|
80
83
|
--[=[
|
|
@@ -170,7 +173,7 @@ end
|
|
|
170
173
|
Observes the current value of the ValueObject
|
|
171
174
|
@return Observable<T?>
|
|
172
175
|
]=]
|
|
173
|
-
function ValueObject.Observe<T>(self: ValueObject<T>): Observable.Observable<T
|
|
176
|
+
function ValueObject.Observe<T>(self: ValueObject<T>): Observable.Observable<T>
|
|
174
177
|
local found = rawget(self :: any, "_observable")
|
|
175
178
|
if found then
|
|
176
179
|
return found
|
|
@@ -201,7 +204,7 @@ function ValueObject.Observe<T>(self: ValueObject<T>): Observable.Observable<T?>
|
|
|
201
204
|
|
|
202
205
|
-- We use a lot of these so let's cache the result which reduces the number of tables we have here
|
|
203
206
|
rawset(self :: any, "_observable", created)
|
|
204
|
-
return created
|
|
207
|
+
return created :: any
|
|
205
208
|
end
|
|
206
209
|
|
|
207
210
|
--[=[
|