function Signal.ConnectOnce(x,d)local z local q=false z=x:Connect(function(...)if q then return end q=true z:Disconnect()d(...)end)return z end function Signal.GetConnections(d)local x={}local z=d._handlerListHead while z do table.insert(x,z)z=z._next end return x end

function Signal:ConnectOnce(fn)
	local connection
	local done = false
	connection = self:Connect(function(...)
		if done then
			return
		end
		done = true
		connection:Disconnect()
		fn(...)
	end)
	return connection
end

function Signal:GetConnections()
	local items = {}
	local item = self._handlerListHead
	while item do
		table.insert(items, item)
		item = item._next
	end
	return items
end
