Add promise:finally

This commit is contained in:
Eryn Lynn 2018-10-23 19:14:29 -04:00
parent 3b30a3fa70
commit 4b95be24d5

View file

@ -290,6 +290,13 @@ function Promise.prototype:catch(failureCallback)
return self:andThen(nil, failureCallback)
end
--[[
Used to set a callback for when the promise resolves OR rejects.
]]
function Promise.prototype:finally(finallyCallback)
return self:andThen(finallyCallback, finallyCallback)
end
--[[
Yield until the promise is completed.