@quenty/promisemaid 5.12.0 → 5.12.1-canary.f294cf2.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
+ ## [5.12.1-canary.f294cf2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promisemaid@5.12.0...@quenty/promisemaid@5.12.1-canary.f294cf2.0) (2025-12-30)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Update typing to be more accurate ([e4c3d05](https://github.com/Quenty/NevermoreEngine/commit/e4c3d05a0aa9f45a37cbfa372c5e0d8a748c9323))
12
+
13
+
14
+
15
+
16
+
6
17
  # [5.12.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promisemaid@5.11.0...@quenty/promisemaid@5.12.0) (2025-08-29)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/promisemaid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/promisemaid",
3
- "version": "5.12.0",
3
+ "version": "5.12.1-canary.f294cf2.0",
4
4
  "description": "Utility methods around promises and maids",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,12 +25,12 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/loader": "^10.9.0",
29
- "@quenty/maid": "^3.5.0",
30
- "@quenty/promise": "^10.12.0"
28
+ "@quenty/loader": "10.9.0",
29
+ "@quenty/maid": "3.5.0",
30
+ "@quenty/promise": "10.12.1-canary.f294cf2.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "5f62fff9bdc4089be64a8380e8deafa77647c85a"
35
+ "gitHead": "f294cf2eec1dd0e95b09d4126287b812b77e1e72"
36
36
  }
@@ -14,8 +14,15 @@ local PromiseMaidUtils = {}
14
14
 
15
15
  --[=[
16
16
  Calls the callback with a maid for the lifetime of the promise.
17
+
18
+ ```lua
19
+ local promise = Promise.delay(5)
20
+ PromiseMaidUtils.whilePromise(promise, function(maid)
21
+ -- Do work while the promise is pending
22
+ end)
23
+ ```
17
24
  ]=]
18
- function PromiseMaidUtils.whilePromise<T...>(promise: Promise.Promise<T...>, callback: (Maid.Maid) -> ()): Maid.Maid
25
+ function PromiseMaidUtils.whilePromise<T...>(promise: Promise.Promise<T...>, callback: ((Maid.Maid) -> ())?): Maid.Maid
19
26
  assert(Promise.isPromise(promise), "Bad promise")
20
27
  assert(type(callback) == "function", "Bad callback")
21
28
 
@@ -29,7 +36,9 @@ function PromiseMaidUtils.whilePromise<T...>(promise: Promise.Promise<T...>, cal
29
36
  maid:DoCleaning()
30
37
  end)
31
38
 
32
- callback(maid)
39
+ if callback then
40
+ callback(maid)
41
+ end
33
42
 
34
43
  -- Cleanup immediately if the callback resolves the promise immeidately
35
44
  if not promise:IsPending() then