@quenty/valuebaseutils 3.5.2 → 3.6.0-canary.241.a4e8214.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 +6 -6
- package/src/Shared/RxValueBaseUtils.lua +36 -0
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
|
+
# [3.6.0-canary.241.a4e8214.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.5.2...@quenty/valuebaseutils@3.6.0-canary.241.a4e8214.0) (2022-01-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Deprecate RxValueBaseUtils.observe and add RxValueBaseUtils.observeBrio ([776b13e](https://github.com/Quenty/NevermoreEngine/commit/776b13ec207b98ca0b4e59aafaf09e2c4c2e2f6c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [3.5.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.5.1...@quenty/valuebaseutils@3.5.2) (2021-12-30)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/valuebaseutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/valuebaseutils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-canary.241.a4e8214.0",
|
|
4
4
|
"description": "Provides utilities for working with valuesbase objects, like IntValue or ObjectValue in Roblox.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/brio": "
|
|
29
|
-
"@quenty/instanceutils": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/promise": "
|
|
28
|
+
"@quenty/brio": "3.6.0-canary.241.a4e8214.0",
|
|
29
|
+
"@quenty/instanceutils": "3.6.0-canary.241.a4e8214.0",
|
|
30
|
+
"@quenty/loader": "3.2.0-canary.241.a4e8214.0",
|
|
31
|
+
"@quenty/promise": "3.4.0-canary.241.a4e8214.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "a4e821471f35998d63f38a4f4a578e07b4e79035"
|
|
37
37
|
}
|
|
@@ -9,8 +9,21 @@ local RxBrioUtils = require("RxBrioUtils")
|
|
|
9
9
|
|
|
10
10
|
local RxValueBaseUtils = {}
|
|
11
11
|
|
|
12
|
+
--[=[
|
|
13
|
+
:::warning
|
|
14
|
+
This caches the last value seen, and may memory leak.
|
|
15
|
+
:::
|
|
16
|
+
|
|
17
|
+
@param parent Instance
|
|
18
|
+
@param className string
|
|
19
|
+
@param name string
|
|
20
|
+
@return Observable<any>
|
|
21
|
+
:::
|
|
22
|
+
]=]
|
|
12
23
|
-- TODO: Handle default value/nothing there, instead of memory leaking!
|
|
13
24
|
function RxValueBaseUtils.observe(parent, className, name)
|
|
25
|
+
warn("[RxValueBaseUtils.observe] - Deprecated since 4.0.0. Use RxValueBaseUtils.observeBrio")
|
|
26
|
+
|
|
14
27
|
return RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
|
|
15
28
|
:Pipe({
|
|
16
29
|
RxBrioUtils.switchMap(function(valueObject)
|
|
@@ -19,6 +32,29 @@ function RxValueBaseUtils.observe(parent, className, name)
|
|
|
19
32
|
})
|
|
20
33
|
end
|
|
21
34
|
|
|
35
|
+
--[=[
|
|
36
|
+
Observes a value base underneath a parent (last named child).
|
|
37
|
+
|
|
38
|
+
@param parent Instance
|
|
39
|
+
@param className string
|
|
40
|
+
@param name string
|
|
41
|
+
@return Observable<Brio<any>>
|
|
42
|
+
]=]
|
|
43
|
+
function RxValueBaseUtils.observeBrio(parent, className, name)
|
|
44
|
+
return RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
|
|
45
|
+
:Pipe({
|
|
46
|
+
RxBrioUtils.switchMapBrio(function(valueObject)
|
|
47
|
+
return RxValueBaseUtils.observeValue(valueObject)
|
|
48
|
+
end)
|
|
49
|
+
})
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
--[=[
|
|
54
|
+
Observables a given value object's value
|
|
55
|
+
@param valueObject Instance
|
|
56
|
+
@return Observable<T>
|
|
57
|
+
]=]
|
|
22
58
|
function RxValueBaseUtils.observeValue(valueObject)
|
|
23
59
|
return RxInstanceUtils.observeProperty(valueObject, "Value")
|
|
24
60
|
end
|