@quenty/blend 6.23.0 → 6.24.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
+ # [6.24.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@6.23.0...@quenty/blend@6.24.0) (2023-07-25)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add SpringObject:ObserveTarget() ([ff3f272](https://github.com/Quenty/NevermoreEngine/commit/ff3f2724a7776dcbcf12389767d7a62319caf63a))
12
+
13
+
14
+
15
+
16
+
6
17
  # [6.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@6.22.0...@quenty/blend@6.23.0) (2023-07-23)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/blend
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/blend",
3
- "version": "6.23.0",
3
+ "version": "6.24.0",
4
4
  "description": "Declarative UI system.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -45,5 +45,5 @@
45
45
  "@quenty/contentproviderutils": "^6.15.0",
46
46
  "@quenty/playerthumbnailutils": "^6.6.0"
47
47
  },
48
- "gitHead": "c1fbe93a0a20b5c0c4b9ffbbac771926b07ac251"
48
+ "gitHead": "d53b0ea25df6a45c600f32c9023c7e7d5ee93387"
49
49
  }
@@ -84,6 +84,31 @@ function SpringObject:Observe()
84
84
  return self:ObserveRenderStepped()
85
85
  end
86
86
 
87
+ --[=[
88
+ Observes the current target of the spring
89
+
90
+ @return Observable<T>
91
+ ]=]
92
+ function SpringObject:ObserveTarget()
93
+ return Observable.new(function(sub)
94
+ local maid = Maid.new()
95
+
96
+ local lastTarget = self.Target
97
+
98
+ maid:GiveTask(self.Changed:Connect(function()
99
+ local target = self.Target
100
+ if lastTarget ~= target then
101
+ lastTarget = target
102
+ sub:Fire(target)
103
+ end
104
+ end))
105
+
106
+ sub:Fire(lastTarget)
107
+
108
+ return maid
109
+ end)
110
+ end
111
+
87
112
  function SpringObject:ObserveVelocityOnRenderStepped()
88
113
  return self:ObserveVelocityOnSignal(RunService.RenderStepped)
89
114
  end