function PromiseUtils.any(v)local Y=Promise.new()local function y(...)Y:Resolve(...)end local function w(...)Y:Reject(...)end for v,Y in pairs(v)do Y:Then(y,w)end return Y end
--[=[
	Returns the value of the first promise resolved
	@param promises { Promise<T> }
	@return Promise<T> -- Promise that resolves with first result
]=]
function PromiseUtils.any(promises)
	local returnPromise = Promise.new()

	local function resolve(...)
		returnPromise:Resolve(...)
	end

	local function reject(...)
		returnPromise:Reject(...)
	end

	for _, promise in pairs(promises) do
		promise:Then(resolve, reject)
	end

	return returnPromise
end
