@quenty/valueobject 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 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
- ## [13.5.1-canary.500.0c613a3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.5.0...@quenty/valueobject@13.5.1-canary.500.0c613a3.0) (2024-09-25)
6
+ # [13.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@13.5.0...@quenty/valueobject@13.6.0) (2024-09-25)
7
7
 
8
8
  **Note:** Version bump only for package @quenty/valueobject
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/valueobject",
3
- "version": "13.5.1-canary.500.0c613a3.0",
3
+ "version": "13.6.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": "14.5.1-canary.500.0c613a3.0",
30
- "@quenty/ducktype": "5.4.1-canary.500.0c613a3.0",
31
- "@quenty/loader": "10.4.1-canary.500.0c613a3.0",
32
- "@quenty/maid": "3.3.0",
33
- "@quenty/rx": "13.5.1-canary.500.0c613a3.0",
34
- "@quenty/signal": "7.4.1-canary.500.0c613a3.0",
35
- "@quenty/valuebaseutils": "13.5.1-canary.500.0c613a3.0"
29
+ "@quenty/brio": "^14.6.0",
30
+ "@quenty/ducktype": "^5.5.0",
31
+ "@quenty/loader": "^10.5.0",
32
+ "@quenty/maid": "^3.3.0",
33
+ "@quenty/rx": "^13.6.0",
34
+ "@quenty/signal": "^7.5.0",
35
+ "@quenty/valuebaseutils": "^13.6.0"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "0c613a3ae0b6ba6a4cda511f572220bfa951c70d"
40
+ "gitHead": "41715b15e2b48b2d22ff4f5277a8d4b7a0d32ef3"
41
41
  }
@@ -148,11 +148,11 @@ function ValueObject:Observe()
148
148
  return
149
149
  end
150
150
 
151
- local connection
151
+ local maid = Maid.new()
152
152
 
153
- connection = self.Changed:Connect(function(newValue, _, ...)
153
+ maid:GiveTask(self.Changed:Connect(function(newValue, _, ...)
154
154
  sub:Fire(newValue, ...)
155
- end)
155
+ end))
156
156
 
157
157
  local args = rawget(self, "_lastEventContext")
158
158
  if args then
@@ -161,7 +161,7 @@ function ValueObject:Observe()
161
161
  sub:Fire(self.Value)
162
162
  end
163
163
 
164
- return connection
164
+ return maid
165
165
  end)
166
166
  end
167
167
 
@@ -37,7 +37,24 @@ end
37
37
  function ValueObjectUtils.observeValue(valueObject)
38
38
  assert(ValueObject.isValueObject(valueObject), "Bad valueObject")
39
39
 
40
- return valueObject:Observe()
40
+ return Observable.new(function(sub)
41
+ if not valueObject.Destroy then
42
+ warn("[ValueObjectUtils.observeValue] - Connecting to dead ValueObject")
43
+ -- No firing, we're dead
44
+ sub:Complete()
45
+ return
46
+ end
47
+
48
+ local maid = Maid.new()
49
+
50
+ maid:GiveTask(valueObject.Changed:Connect(function()
51
+ sub:Fire(valueObject.Value)
52
+ end))
53
+
54
+ sub:Fire(valueObject.Value)
55
+
56
+ return maid
57
+ end)
41
58
  end
42
59
 
43
60
  --[=[