@quenty/brio 14.4.0 → 14.5.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
+ # [14.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/brio@14.4.0...@quenty/brio@14.5.0) (2024-09-12)
7
+
8
+
9
+ ### Features
10
+
11
+ * Unedited all changes ([60e64e3](https://github.com/Quenty/NevermoreEngine/commit/60e64e3efce17c10c4b8965871187d231b338dd4))
12
+
13
+
14
+
15
+
16
+
6
17
  # [14.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/brio@14.3.0...@quenty/brio@14.4.0) (2024-08-09)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/brio
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/brio",
3
- "version": "14.4.0",
3
+ "version": "14.5.0",
4
4
  "description": "Brios wrap an object and either are alive or dead",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,14 +26,14 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/loader": "^10.3.0",
30
- "@quenty/maid": "^3.2.0",
31
- "@quenty/rx": "^13.4.0",
32
- "@quenty/signal": "^7.3.0",
29
+ "@quenty/loader": "^10.4.0",
30
+ "@quenty/maid": "^3.3.0",
31
+ "@quenty/rx": "^13.5.0",
32
+ "@quenty/signal": "^7.4.0",
33
33
  "@quenty/steputils": "^3.4.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "ba466bdbc05c42fb607cf5e228c16339201d21d7"
38
+ "gitHead": "fb172906f3ee725269ec1e5f4daf9dca227e729d"
39
39
  }
@@ -770,10 +770,13 @@ end
770
770
 
771
771
  @since 3.6.0
772
772
  @function switchToBrio
773
+ @param predicate ((T) -> boolean)?
773
774
  @return (source: Observable<T | Brio<T>>) -> Observable<Brio<T>>
774
775
  @within RxBrioUtils
775
776
  ]=]
776
- function RxBrioUtils.switchToBrio()
777
+ function RxBrioUtils.switchToBrio(predicate)
778
+ assert(type(predicate) == "function" or predicate == nil, "Bad predicate")
779
+
777
780
  return function(source)
778
781
  return Observable.new(function(sub)
779
782
  local topMaid = Maid.new()
@@ -785,17 +788,24 @@ function RxBrioUtils.switchToBrio()
785
788
  return
786
789
  end
787
790
 
788
- local maid = result:ToMaid()
789
- local newBrio = Brio.new(result:GetValue())
790
- maid:GiveTask(newBrio)
791
+ if predicate == nil or predicate(result:GetValue()) then
792
+ local maid = result:ToMaid()
793
+ local newBrio = maid:Add(Brio.new(result:GetValue()))
794
+ sub:Fire(newBrio)
791
795
 
792
- topMaid._last = maid
793
- sub:Fire(newBrio)
796
+ topMaid._last = maid
797
+ else
798
+ topMaid._last = nil
799
+ end
794
800
  else
795
- local newBrio = Brio.new(result, ...)
801
+ if predicate == nil or predicate(result, ...) then
802
+ local newBrio = Brio.new(result, ...)
796
803
 
797
- topMaid._last = newBrio
798
- sub:Fire(newBrio)
804
+ topMaid._last = newBrio
805
+ sub:Fire(newBrio)
806
+ else
807
+ topMaid._last = nil
808
+ end
799
809
  end
800
810
  end, sub:GetFailComplete()))
801
811