@quenty/instanceutils 13.5.1-canary.500.0c613a3.0 → 13.6.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 +1 -1
- package/package.json +7 -7
- package/src/Shared/RxInstanceUtils.lua +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
|
|
6
|
+
# [13.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/instanceutils@13.5.0...@quenty/instanceutils@13.6.0) (2024-09-25)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @quenty/instanceutils
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/instanceutils",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.6.0",
|
|
4
4
|
"description": "Utility functions involving instances in Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/brio": "14.
|
|
30
|
-
"@quenty/loader": "10.
|
|
31
|
-
"@quenty/maid": "3.3.0",
|
|
32
|
-
"@quenty/rx": "13.
|
|
33
|
-
"@quenty/symbol": "3.1.0"
|
|
29
|
+
"@quenty/brio": "^14.6.0",
|
|
30
|
+
"@quenty/loader": "^10.5.0",
|
|
31
|
+
"@quenty/maid": "^3.3.0",
|
|
32
|
+
"@quenty/rx": "^13.6.0",
|
|
33
|
+
"@quenty/symbol": "^3.1.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "41715b15e2b48b2d22ff4f5277a8d4b7a0d32ef3"
|
|
39
39
|
}
|
|
@@ -34,12 +34,14 @@ function RxInstanceUtils.observeProperty(instance, propertyName)
|
|
|
34
34
|
assert(type(propertyName) == "string", "'propertyName' should be of type string")
|
|
35
35
|
|
|
36
36
|
return Observable.new(function(sub)
|
|
37
|
-
local
|
|
37
|
+
local maid = Maid.new()
|
|
38
|
+
|
|
39
|
+
maid:GiveTask(instance:GetPropertyChangedSignal(propertyName):Connect(function()
|
|
38
40
|
sub:Fire(instance[propertyName], instance)
|
|
39
|
-
end)
|
|
41
|
+
end))
|
|
40
42
|
sub:Fire(instance[propertyName], instance)
|
|
41
43
|
|
|
42
|
-
return
|
|
44
|
+
return maid
|
|
43
45
|
end)
|
|
44
46
|
end
|
|
45
47
|
|
|
@@ -120,6 +122,8 @@ function RxInstanceUtils.observeFirstAncestor(instance, className)
|
|
|
120
122
|
assert(type(className) == "string", "Bad className")
|
|
121
123
|
|
|
122
124
|
return Observable.new(function(sub)
|
|
125
|
+
local maid = Maid.new()
|
|
126
|
+
|
|
123
127
|
local lastFound = UNSET_VALUE
|
|
124
128
|
local function handleAncestryChanged()
|
|
125
129
|
local found = instance:FindFirstAncestorWhichIsA(className)
|
|
@@ -129,10 +133,10 @@ function RxInstanceUtils.observeFirstAncestor(instance, className)
|
|
|
129
133
|
end
|
|
130
134
|
end
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
maid:GiveTask(instance.AncestryChanged:Connect(handleAncestryChanged))
|
|
133
137
|
handleAncestryChanged()
|
|
134
138
|
|
|
135
|
-
return
|
|
139
|
+
return maid
|
|
136
140
|
end)
|
|
137
141
|
end
|
|
138
142
|
|