@quenty/blend 12.15.0 → 12.16.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
+ # [12.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.15.0...@quenty/blend@12.16.0) (2025-01-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * Can cancel observable ([95d66c8](https://github.com/Quenty/NevermoreEngine/commit/95d66c824f08372796129caf7672d5f6f5cd2139))
12
+
13
+
14
+
15
+
16
+
6
17
  # [12.15.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/blend@12.14.0...@quenty/blend@12.15.0) (2024-12-15)
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": "12.15.0",
3
+ "version": "12.16.0",
4
4
  "description": "Declarative UI system.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -46,5 +46,5 @@
46
46
  "@quenty/contentproviderutils": "^12.15.0",
47
47
  "@quenty/playerthumbnailutils": "^10.9.0"
48
48
  },
49
- "gitHead": "0a20ace4dc7d38f8c889bf73b716b33e8a767c54"
49
+ "gitHead": "a55ec046e30ddacc356f3d93fcbc6058888a88f6"
50
50
  }
@@ -268,12 +268,16 @@ function SpringObject:SetTarget(target, doNotAnimate)
268
268
  if not observable then
269
269
  self._maid._targetSub = nil
270
270
  self:_applyTarget(target, doNotAnimate)
271
- return
271
+ return function()
272
+
273
+ end
272
274
  end
273
275
 
276
+ local sub
277
+ self._maid._targetSub = nil
274
278
  if doNotAnimate then
275
279
  local isFirst = true
276
- self._maid._targetSub = observable:Subscribe(function(unconverted)
280
+ sub = observable:Subscribe(function(unconverted)
277
281
  local converted = SpringUtils.toLinearIfNeeded(unconverted)
278
282
  assert(converted, "Not a valid converted target")
279
283
 
@@ -282,10 +286,18 @@ function SpringObject:SetTarget(target, doNotAnimate)
282
286
  self:_applyTarget(unconverted, wasFirst)
283
287
  end)
284
288
  else
285
- self._maid._targetSub = observable:Subscribe(function(unconverted)
289
+ sub = observable:Subscribe(function(unconverted)
286
290
  self:_applyTarget(unconverted, doNotAnimate)
287
291
  end)
288
292
  end
293
+
294
+ self._maid._targetSub = sub
295
+
296
+ return function()
297
+ if self._maid._targetSub == sub then
298
+ self._maid._targetSub = nil
299
+ end
300
+ end
289
301
  end
290
302
 
291
303
  function SpringObject:_applyTarget(unconverted, doNotAnimate)