@quenty/rx 13.17.2 → 13.17.3
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,14 @@
|
|
|
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.17.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rx@13.17.2...@quenty/rx@13.17.3) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/rx
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [13.17.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rx@13.17.0...@quenty/rx@13.17.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rx",
|
|
3
|
-
"version": "13.17.
|
|
3
|
+
"version": "13.17.3",
|
|
4
4
|
"description": "Quenty's reactive library for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@quenty/cancellabledelay": "^3.5.2",
|
|
31
|
-
"@quenty/canceltoken": "^11.11.
|
|
32
|
-
"@quenty/ducktype": "^5.8.
|
|
33
|
-
"@quenty/loader": "^10.8.
|
|
34
|
-
"@quenty/maid": "^3.4.
|
|
35
|
-
"@quenty/promise": "^10.10.
|
|
36
|
-
"@quenty/signal": "^7.10.
|
|
31
|
+
"@quenty/canceltoken": "^11.11.4",
|
|
32
|
+
"@quenty/ducktype": "^5.8.4",
|
|
33
|
+
"@quenty/loader": "^10.8.3",
|
|
34
|
+
"@quenty/maid": "^3.4.3",
|
|
35
|
+
"@quenty/promise": "^10.10.4",
|
|
36
|
+
"@quenty/signal": "^7.10.3",
|
|
37
37
|
"@quenty/symbol": "^3.4.2",
|
|
38
|
-
"@quenty/table": "^3.7.
|
|
39
|
-
"@quenty/throttle": "^10.9.
|
|
40
|
-
"@quenty/typeutils": "^1.0.
|
|
38
|
+
"@quenty/table": "^3.7.4",
|
|
39
|
+
"@quenty/throttle": "^10.9.3",
|
|
40
|
+
"@quenty/typeutils": "^1.0.3"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
|
|
46
46
|
}
|
|
@@ -18,11 +18,11 @@ export type ObservableSubscriptionTable<T...> = typeof(setmetatable(
|
|
|
18
18
|
{} :: {
|
|
19
19
|
_subMap: { [any]: { _Subscription.Subscription<T...> } },
|
|
20
20
|
},
|
|
21
|
-
ObservableSubscriptionTable
|
|
21
|
+
{} :: typeof({ __index = ObservableSubscriptionTable })
|
|
22
22
|
))
|
|
23
23
|
|
|
24
24
|
function ObservableSubscriptionTable.new<T...>(): ObservableSubscriptionTable<T...>
|
|
25
|
-
local self = setmetatable({} :: any, ObservableSubscriptionTable)
|
|
25
|
+
local self: ObservableSubscriptionTable<T...> = setmetatable({} :: any, ObservableSubscriptionTable)
|
|
26
26
|
|
|
27
27
|
self._subMap = {} -- { TKey: Subscription<TEmit> }
|
|
28
28
|
|
|
@@ -66,7 +66,7 @@ end
|
|
|
66
66
|
|
|
67
67
|
@param key TKey
|
|
68
68
|
]=]
|
|
69
|
-
function ObservableSubscriptionTable.Complete<T...>(self: ObservableSubscriptionTable<T...>, key: any)
|
|
69
|
+
function ObservableSubscriptionTable.Complete<T...>(self: ObservableSubscriptionTable<T...>, key: any): ()
|
|
70
70
|
local subs = self._subMap[key]
|
|
71
71
|
if not subs then
|
|
72
72
|
return
|
|
@@ -87,7 +87,7 @@ end
|
|
|
87
87
|
|
|
88
88
|
@param key TKey
|
|
89
89
|
]=]
|
|
90
|
-
function ObservableSubscriptionTable.Fail<T...>(self: ObservableSubscriptionTable<T...>, key: any)
|
|
90
|
+
function ObservableSubscriptionTable.Fail<T...>(self: ObservableSubscriptionTable<T...>, key: any): ()
|
|
91
91
|
local subs = self._subMap[key]
|
|
92
92
|
if not subs then
|
|
93
93
|
return
|
|
@@ -157,7 +157,7 @@ end
|
|
|
157
157
|
--[=[
|
|
158
158
|
Completes all subscriptions and removes them from the list.
|
|
159
159
|
]=]
|
|
160
|
-
function ObservableSubscriptionTable.Destroy<T...>(self: ObservableSubscriptionTable<T...>)
|
|
160
|
+
function ObservableSubscriptionTable.Destroy<T...>(self: ObservableSubscriptionTable<T...>): ()
|
|
161
161
|
while next(self._subMap) do
|
|
162
162
|
local key, list = next(self._subMap)
|
|
163
163
|
assert(key, "Key should not be nil")
|
package/src/Shared/Rx.lua
CHANGED
|
@@ -164,7 +164,10 @@ end
|
|
|
164
164
|
@param cancelToken CancelToken?
|
|
165
165
|
@return Promise<T>
|
|
166
166
|
]=]
|
|
167
|
-
function Rx.toPromise(
|
|
167
|
+
function Rx.toPromise<T...>(
|
|
168
|
+
observable: Observable.Observable<T...>,
|
|
169
|
+
cancelToken: CancelToken.CancelToken?
|
|
170
|
+
): Promise.Promise<T...>
|
|
168
171
|
assert(Observable.isObservable(observable), "Bad observable")
|
|
169
172
|
|
|
170
173
|
local maid = Maid.new()
|
|
@@ -301,7 +304,11 @@ end
|
|
|
301
304
|
@param onComplete function?
|
|
302
305
|
@return (source: Observable<T>) -> Observable<T>
|
|
303
306
|
]=]
|
|
304
|
-
function Rx.tap(
|
|
307
|
+
function Rx.tap<T...>(
|
|
308
|
+
onFire: _Subscription.FireCallback<T...>?,
|
|
309
|
+
onError: _Subscription.FailCallback?,
|
|
310
|
+
onComplete: _Subscription.CompleteCallback?
|
|
311
|
+
): Observable.Transformer<T..., T...>
|
|
305
312
|
assert(type(onFire) == "function" or onFire == nil, "Bad onFire")
|
|
306
313
|
assert(type(onError) == "function" or onError == nil, "Bad onError")
|
|
307
314
|
assert(type(onComplete) == "function" or onComplete == nil, "Bad onComplete")
|
|
@@ -328,7 +335,7 @@ function Rx.tap(onFire, onError, onComplete)
|
|
|
328
335
|
end
|
|
329
336
|
sub:Complete(...)
|
|
330
337
|
end)
|
|
331
|
-
end)
|
|
338
|
+
end) :: any
|
|
332
339
|
end
|
|
333
340
|
end
|
|
334
341
|
|
|
@@ -348,7 +355,7 @@ function Rx.start<T...>(callback: () -> T...): Observable.Transformer<T..., T...
|
|
|
348
355
|
sub:Fire(callback())
|
|
349
356
|
|
|
350
357
|
return source:Subscribe(sub:GetFireFailComplete())
|
|
351
|
-
end)
|
|
358
|
+
end) :: any
|
|
352
359
|
end
|
|
353
360
|
end
|
|
354
361
|
|
|
@@ -361,7 +368,7 @@ end
|
|
|
361
368
|
@return (source: Observable) -> Observable
|
|
362
369
|
]=]
|
|
363
370
|
function Rx.share<T...>(): Observable.Transformer<T..., T...>
|
|
364
|
-
return function(source)
|
|
371
|
+
return function(source)
|
|
365
372
|
local shareMaid = Maid.new()
|
|
366
373
|
local subs: { _Subscription.Subscription<T...> } = {}
|
|
367
374
|
|
|
@@ -554,7 +561,7 @@ function Rx.shareReplay<T...>(bufferSize: number?, windowTimeSeconds: number?):
|
|
|
554
561
|
end
|
|
555
562
|
end
|
|
556
563
|
end
|
|
557
|
-
end) ::
|
|
564
|
+
end) :: any
|
|
558
565
|
end
|
|
559
566
|
end
|
|
560
567
|
|
|
@@ -798,7 +805,7 @@ end
|
|
|
798
805
|
function Rx.where<T...>(predicate: Predicate<T...>): Observable.Transformer<T..., T...>
|
|
799
806
|
assert(type(predicate) == "function", "Bad predicate callback")
|
|
800
807
|
|
|
801
|
-
return function(source: Observable.Observable<T...>)
|
|
808
|
+
return function(source: Observable.Observable<T...>)
|
|
802
809
|
assert(Observable.isObservable(source), "Bad observable")
|
|
803
810
|
|
|
804
811
|
return Observable.new(function(sub)
|
|
@@ -807,7 +814,7 @@ function Rx.where<T...>(predicate: Predicate<T...>): Observable.Transformer<T...
|
|
|
807
814
|
sub:Fire(...)
|
|
808
815
|
end
|
|
809
816
|
end, sub:GetFailComplete())
|
|
810
|
-
end)
|
|
817
|
+
end) :: any
|
|
811
818
|
end
|
|
812
819
|
end
|
|
813
820
|
|
|
@@ -839,7 +846,7 @@ function Rx.distinct<T...>(): Observable.Transformer<T..., T...>
|
|
|
839
846
|
last = value
|
|
840
847
|
sub:Fire(last)
|
|
841
848
|
end, sub:GetFailComplete())
|
|
842
|
-
end) ::
|
|
849
|
+
end) :: any
|
|
843
850
|
end
|
|
844
851
|
end
|
|
845
852
|
|
|
@@ -887,7 +894,7 @@ function Rx.map<T..., U...>(project: (T...) -> U...): Observable.Transformer<T..
|
|
|
887
894
|
return source:Subscribe(function(...)
|
|
888
895
|
sub:Fire(project(...))
|
|
889
896
|
end, sub:GetFailComplete())
|
|
890
|
-
end) ::
|
|
897
|
+
end) :: any
|
|
891
898
|
end
|
|
892
899
|
end
|
|
893
900
|
|
|
@@ -938,7 +945,7 @@ end
|
|
|
938
945
|
function Rx.flatMap<T..., U...>(project: (T...) -> Observable.Observable<U...>): Observable.Transformer<(T...), (U...)>
|
|
939
946
|
assert(type(project) == "function", "Bad project")
|
|
940
947
|
|
|
941
|
-
return function(source: Observable.Observable<T...>)
|
|
948
|
+
return function(source: Observable.Observable<T...>)
|
|
942
949
|
assert(Observable.isObservable(source), "Bad observable")
|
|
943
950
|
|
|
944
951
|
return Observable.new(function(sub: _Subscription.Subscription<U...>)
|
|
@@ -1194,7 +1201,7 @@ function Rx.switchMap<T..., U...>(project: (T...) -> Observable.Observable<U...>
|
|
|
1194
1201
|
|
|
1195
1202
|
outerSubscription:Destroy()
|
|
1196
1203
|
end
|
|
1197
|
-
end) ::
|
|
1204
|
+
end) :: any
|
|
1198
1205
|
end
|
|
1199
1206
|
end
|
|
1200
1207
|
|
|
@@ -1662,7 +1669,7 @@ function Rx.take<T...>(number: number): Observable.Transformer<T..., T...>
|
|
|
1662
1669
|
end, sub:GetFailComplete())
|
|
1663
1670
|
|
|
1664
1671
|
return maid
|
|
1665
|
-
end) ::
|
|
1672
|
+
end) :: any
|
|
1666
1673
|
end
|
|
1667
1674
|
end
|
|
1668
1675
|
|
|
@@ -1694,7 +1701,7 @@ function Rx.skip<T...>(toSkip: number): Observable.Transformer<T..., T...>
|
|
|
1694
1701
|
end, sub:GetFailComplete()))
|
|
1695
1702
|
|
|
1696
1703
|
return maid
|
|
1697
|
-
end) ::
|
|
1704
|
+
end) :: any
|
|
1698
1705
|
end
|
|
1699
1706
|
end
|
|
1700
1707
|
|
|
@@ -1754,7 +1761,7 @@ function Rx.delay<T...>(seconds: number): Observable.Transformer<T..., T...>
|
|
|
1754
1761
|
end, sub:GetFailComplete()))
|
|
1755
1762
|
|
|
1756
1763
|
return maid
|
|
1757
|
-
end) ::
|
|
1764
|
+
end) :: any
|
|
1758
1765
|
end
|
|
1759
1766
|
end
|
|
1760
1767
|
|
|
@@ -1934,7 +1941,7 @@ end
|
|
|
1934
1941
|
|
|
1935
1942
|
@return (source: Observable) -> Observable
|
|
1936
1943
|
]=]
|
|
1937
|
-
function Rx.throttleDefer()
|
|
1944
|
+
function Rx.throttleDefer<T...>(): Observable.Transformer<T..., T...>
|
|
1938
1945
|
return function(source)
|
|
1939
1946
|
assert(Observable.isObservable(source), "Bad observable")
|
|
1940
1947
|
|
|
@@ -1970,7 +1977,7 @@ function Rx.throttleDefer()
|
|
|
1970
1977
|
|
|
1971
1978
|
sourceSub:Destroy()
|
|
1972
1979
|
end
|
|
1973
|
-
end)
|
|
1980
|
+
end) :: any
|
|
1974
1981
|
end
|
|
1975
1982
|
end
|
|
1976
1983
|
|