@quenty/valuebaseutils 4.0.0-canary.236.5597d0a.0 → 4.0.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 +60 -1
- package/README.md +5 -3
- package/package.json +6 -6
- package/src/Shared/RxValueBaseUtils.lua +39 -3
- package/src/Shared/ValueBaseUtils.lua +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,66 @@
|
|
|
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
|
-
# [4.0.0
|
|
6
|
+
# [4.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.8.0...@quenty/valuebaseutils@4.0.0) (2022-03-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.7.1...@quenty/valuebaseutils@3.8.0) (2022-01-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.7.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.7.0...@quenty/valuebaseutils@3.7.1) (2022-01-16)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [3.7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.6.0...@quenty/valuebaseutils@3.7.0) (2022-01-07)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [3.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.5.2...@quenty/valuebaseutils@3.6.0) (2022-01-03)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* Deprecate RxValueBaseUtils.observe and add RxValueBaseUtils.observeBrio ([2c18d19](https://github.com/Quenty/NevermoreEngine/commit/2c18d19bdd13fbdecefc6f474fad479a45e92559))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [3.5.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.5.1...@quenty/valuebaseutils@3.5.2) (2021-12-30)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [3.5.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.5.0...@quenty/valuebaseutils@3.5.1) (2021-12-30)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# [3.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valuebaseutils@3.4.0...@quenty/valuebaseutils@3.5.0) (2021-12-18)
|
|
7
66
|
|
|
8
67
|
**Note:** Version bump only for package @quenty/valuebaseutils
|
|
9
68
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## ValueBaseUtils
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
Provides utilities for working with valuesbase objects, like IntValue or ObjectValue in Roblox.
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/ValueBaseUtils">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/valuebaseutils --save
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/valuebaseutils",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.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": "4.0.0
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/promise": "4.0.0
|
|
28
|
+
"@quenty/brio": "^5.0.0",
|
|
29
|
+
"@quenty/instanceutils": "^4.0.0",
|
|
30
|
+
"@quenty/loader": "^4.0.0",
|
|
31
|
+
"@quenty/promise": "^4.0.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "dd428cab58282c975a4c082957dc8f58e3186905"
|
|
37
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
@class RxValueBaseUtils
|
|
3
|
+
]=]
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
@@ -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
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Provides utilities for working with valuesbase objects, like IntValue or ObjectValue in Roblox.
|
|
3
|
+
@class ValueBaseUtils
|
|
4
|
+
]=]
|
|
4
5
|
|
|
5
6
|
local ValueBaseUtils = {}
|
|
6
7
|
|