mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 15:50:01 +00:00
Add type assertion to onCancel
This commit is contained in:
parent
dbcad4ab4b
commit
4f5ed034e0
1 changed files with 2 additions and 0 deletions
|
@ -168,6 +168,8 @@ function Promise.new(callback, parent)
|
|||
end
|
||||
|
||||
local function onCancel(cancellationHook)
|
||||
assert(type(cancellationHook) == "function", "onCancel must be called with a function as its first argument.")
|
||||
|
||||
self._cancellationHook = cancellationHook
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue