mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 15:50:01 +00:00
Add some comments
This commit is contained in:
parent
17fac4d008
commit
d61ce8ed97
1 changed files with 8 additions and 0 deletions
|
@ -15,12 +15,20 @@ local function pack(...)
|
|||
return len, { ... }
|
||||
end
|
||||
|
||||
--[[
|
||||
Returns first value (success), and packs all following values.
|
||||
]]
|
||||
local function packResult(...)
|
||||
local result = (...)
|
||||
|
||||
return result, pack(select(2, ...))
|
||||
end
|
||||
|
||||
--[[
|
||||
Calls a non-yielding function in a new coroutine.
|
||||
|
||||
Handles errors if they happen.
|
||||
]]
|
||||
local function ppcall(callback, ...)
|
||||
local co = coroutine.create(callback)
|
||||
|
||||
|
|
Loading…
Reference in a new issue