@quenty/promise 10.10.3 → 10.10.4
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
|
+
## [10.10.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@10.10.3...@quenty/promise@10.10.4) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/promise
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [10.10.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@10.10.1...@quenty/promise@10.10.3) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/promise",
|
|
3
|
-
"version": "10.10.
|
|
3
|
+
"version": "10.10.4",
|
|
4
4
|
"description": "Promise implementation for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@quenty/deferred": "^2.2.2",
|
|
29
|
-
"@quenty/loader": "^10.8.
|
|
30
|
-
"@quenty/maid": "^3.4.
|
|
29
|
+
"@quenty/loader": "^10.8.3",
|
|
30
|
+
"@quenty/maid": "^3.4.3",
|
|
31
31
|
"@quenty/math": "^2.7.3"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
|
|
37
37
|
}
|
package/src/Shared/Promise.lua
CHANGED
|
@@ -31,7 +31,7 @@ export type Promise<T...> = typeof(setmetatable(
|
|
|
31
31
|
_pendingExecuteList: { any }?,
|
|
32
32
|
_source: string,
|
|
33
33
|
},
|
|
34
|
-
Promise
|
|
34
|
+
{} :: typeof({ __index = Promise })
|
|
35
35
|
))
|
|
36
36
|
|
|
37
37
|
--[=[
|
|
@@ -408,7 +408,7 @@ end
|
|
|
408
408
|
@param onRejected function -- Called if/when rejected with parameters
|
|
409
409
|
@return Promise<T...>
|
|
410
410
|
]=]
|
|
411
|
-
function Promise.Then<T...>(self: Promise<T...>, onFulfilled
|
|
411
|
+
function Promise.Then<T...>(self: Promise<T...>, onFulfilled: ((T...) -> any...)?, onRejected: ((...any) -> any...)?)
|
|
412
412
|
if type(onRejected) == "function" then
|
|
413
413
|
self._unconsumedException = false
|
|
414
414
|
end
|
|
@@ -27,7 +27,7 @@ function PromiseUtils.any<T...>(promises: { Promise.Promise<T...> }): Promise.Pr
|
|
|
27
27
|
returnPromise:Reject(...)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
for _, promise in promises do
|
|
30
|
+
for _, promise: any in promises do
|
|
31
31
|
promise:Then(resolve, reject)
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -67,11 +67,11 @@ function PromiseUtils.all<T>(promises: { Promise.Promise<T> }): Promise.Promise<
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
local remainingCount = #promises
|
|
70
|
-
local returnPromise = Promise.new()
|
|
70
|
+
local returnPromise: Promise.Promise<T> = Promise.new()
|
|
71
71
|
local results = {}
|
|
72
72
|
local allFulfilled = true
|
|
73
73
|
|
|
74
|
-
local function syncronize(index, isFullfilled)
|
|
74
|
+
local function syncronize(index: number, isFullfilled: boolean)
|
|
75
75
|
return function(value)
|
|
76
76
|
allFulfilled = allFulfilled and isFullfilled
|
|
77
77
|
results[index] = value
|
|
@@ -83,7 +83,7 @@ function PromiseUtils.all<T>(promises: { Promise.Promise<T> }): Promise.Promise<
|
|
|
83
83
|
end
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
for index, promise in promises do
|
|
86
|
+
for index, promise: any in promises do
|
|
87
87
|
promise:Then(syncronize(index, true), syncronize(index, false))
|
|
88
88
|
end
|
|
89
89
|
|
|
@@ -103,8 +103,8 @@ function PromiseUtils.firstSuccessOrLastFailure<T...>(promises: { Promise.Promis
|
|
|
103
103
|
return promises[1]
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
local remainingCount = #promises
|
|
107
|
-
local returnPromise = Promise.new()
|
|
106
|
+
local remainingCount: number = #promises
|
|
107
|
+
local returnPromise: Promise.Promise<T...> = Promise.new()
|
|
108
108
|
|
|
109
109
|
local function syncronize(isFullfilled)
|
|
110
110
|
return function(...)
|
|
@@ -122,7 +122,7 @@ function PromiseUtils.firstSuccessOrLastFailure<T...>(promises: { Promise.Promis
|
|
|
122
122
|
end
|
|
123
123
|
end
|
|
124
124
|
|
|
125
|
-
for _, promise in promises do
|
|
125
|
+
for _, promise: any in promises do
|
|
126
126
|
promise:Then(syncronize(true), syncronize(false))
|
|
127
127
|
end
|
|
128
128
|
|