@quenty/valueobject 13.17.3 → 13.17.4-canary.11a5dcf.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,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
|
+
## [13.17.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.17.3...@quenty/valueobject@13.17.4-canary.11a5dcf.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [13.17.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.17.2...@quenty/valueobject@13.17.3) (2025-04-10)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/valueobject
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/valueobject",
|
|
3
|
-
"version": "13.17.
|
|
3
|
+
"version": "13.17.4-canary.11a5dcf.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.4-canary.11a5dcf.0",
|
|
30
|
+
"@quenty/ducktype": "5.8.5-canary.11a5dcf.0",
|
|
31
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/maid": "3.4.4-canary.11a5dcf.0",
|
|
33
|
+
"@quenty/rx": "13.17.4-canary.11a5dcf.0",
|
|
34
|
+
"@quenty/signal": "7.10.4-canary.11a5dcf.0",
|
|
35
|
+
"@quenty/valuebaseutils": "13.17.4-canary.11a5dcf.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
41
41
|
}
|
|
@@ -12,11 +12,11 @@ local DuckTypeUtils = require("DuckTypeUtils")
|
|
|
12
12
|
local Maid = require("Maid")
|
|
13
13
|
local MaidTaskUtils = require("MaidTaskUtils")
|
|
14
14
|
local Observable = require("Observable")
|
|
15
|
+
local Rx = require("Rx")
|
|
15
16
|
local RxValueBaseUtils = require("RxValueBaseUtils")
|
|
16
17
|
local Signal = require("Signal")
|
|
18
|
+
local Subscription = require("Subscription")
|
|
17
19
|
local ValueBaseUtils = require("ValueBaseUtils")
|
|
18
|
-
local _Subscription = require("Subscription")
|
|
19
|
-
local _Rx = require("Rx")
|
|
20
20
|
|
|
21
21
|
local EMPTY_FUNCTION = function() end
|
|
22
22
|
|
|
@@ -27,6 +27,8 @@ export type TypeChecker = (value: any) -> (boolean, string?)
|
|
|
27
27
|
|
|
28
28
|
export type ValueObjectTypeArg = string | TypeChecker
|
|
29
29
|
|
|
30
|
+
export type Mountable<T> = T | Observable.Observable<T> | ValueBase | ValueObject<T>
|
|
31
|
+
|
|
30
32
|
export type ValueObject<T> = typeof(setmetatable(
|
|
31
33
|
{} :: {
|
|
32
34
|
--[=[
|
|
@@ -48,7 +50,7 @@ export type ValueObject<T> = typeof(setmetatable(
|
|
|
48
50
|
_value: T,
|
|
49
51
|
_default: T?,
|
|
50
52
|
_lastEventContext: { any }?,
|
|
51
|
-
_lastMountedSub:
|
|
53
|
+
_lastMountedSub: Subscription.Subscription<(T, ...any)>?,
|
|
52
54
|
},
|
|
53
55
|
{} :: typeof({ __index = ValueObject })
|
|
54
56
|
))
|
|
@@ -111,7 +113,7 @@ function ValueObject.isValueObject(value: any): boolean
|
|
|
111
113
|
return DuckTypeUtils.isImplementation(ValueObject, value)
|
|
112
114
|
end
|
|
113
115
|
|
|
114
|
-
function ValueObject._toMountableObservable<T>(_self: ValueObject<T>, value:
|
|
116
|
+
function ValueObject._toMountableObservable<T>(_self: ValueObject<T>, value: Mountable<T>)
|
|
115
117
|
if Observable.isObservable(value) then
|
|
116
118
|
return value
|
|
117
119
|
elseif typeof(value) == "Instance" then
|
|
@@ -136,7 +138,7 @@ end
|
|
|
136
138
|
@param value Observable | T
|
|
137
139
|
@return MaidTask
|
|
138
140
|
]=]
|
|
139
|
-
function ValueObject.Mount<T>(self: ValueObject<T>, value:
|
|
141
|
+
function ValueObject.Mount<T>(self: ValueObject<T>, value: Mountable<T>): () -> ()
|
|
140
142
|
local observable = self:_toMountableObservable(value)
|
|
141
143
|
if observable then
|
|
142
144
|
self:_cleanupLastMountedSub()
|
|
@@ -213,10 +215,7 @@ end
|
|
|
213
215
|
@param condition function | nil -- optional
|
|
214
216
|
@return Observable<Brio<T>>
|
|
215
217
|
]=]
|
|
216
|
-
function ValueObject.ObserveBrio<T>(
|
|
217
|
-
self: ValueObject<T>,
|
|
218
|
-
condition: _Rx.Predicate<T>?
|
|
219
|
-
): Observable.Observable<Brio.Brio<T>>
|
|
218
|
+
function ValueObject.ObserveBrio<T>(self: ValueObject<T>, condition: Rx.Predicate<T>?): Observable.Observable<Brio.Brio<T>>
|
|
220
219
|
assert(type(condition) == "function" or condition == nil, "Bad condition")
|
|
221
220
|
|
|
222
221
|
return Observable.new(function(sub)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local Maid = require("Maid")
|
|
10
9
|
local Brio = require("Brio")
|
|
10
|
+
local Maid = require("Maid")
|
|
11
11
|
local Observable = require("Observable")
|
|
12
12
|
local ValueObject = require("ValueObject")
|
|
13
13
|
|
|
@@ -68,4 +68,4 @@ function ValueObjectUtils.observeValueBrio<T>(valueObject: ValueObject.ValueObje
|
|
|
68
68
|
end) :: any
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
return ValueObjectUtils
|
|
71
|
+
return ValueObjectUtils
|