function PromiseInstanceUtils.promiseRemoved(G)assert(G:IsDescendantOf(game))local z=Maid.new()local q=Promise.new()z:GiveTask(G.AncestryChanged:Connect(function(G,z)if not z then q:Resolve()end end))q:Finally(function()z:DoCleaning()end)return q end return PromiseInstanceUtils
--[=[
	@param instance Instance
	@return Promise
]=]
function PromiseInstanceUtils.promiseRemoved(instance)
	assert(instance:IsDescendantOf(game))

	local maid = Maid.new()

	local promise = Promise.new()

	maid:GiveTask(instance.AncestryChanged:Connect(function(_, parent)
		if not parent then
			promise:Resolve()
		end
	end))

	promise:Finally(function()
		maid:DoCleaning()
	end)

	return promise
end

return PromiseInstanceUtils
