mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 15:50:01 +00:00
Update to Promise version from Rojo, which changes await()
This commit is contained in:
parent
9bc03fc001
commit
7fb09d103f
1 changed files with 3 additions and 7 deletions
10
lib/init.lua
10
lib/init.lua
|
@ -221,15 +221,11 @@ function Promise:await()
|
|||
local ok = bindable.Event:Wait()
|
||||
bindable:Destroy()
|
||||
|
||||
if not ok then
|
||||
error(tostring(result[1]), 2)
|
||||
end
|
||||
|
||||
return unpack(result)
|
||||
return ok, unpack(result)
|
||||
elseif self._status == Promise.Status.Resolved then
|
||||
return unpack(self._value)
|
||||
return true, unpack(self._value)
|
||||
elseif self._status == Promise.Status.Rejected then
|
||||
error(tostring(self._value[1]), 2)
|
||||
return false, unpack(self._value)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue