-- Implement Signal:Wait() in terms of a temporary connection using
-- a Signal:Connect() which disconnects itself.

function Signal.Wait(self: ClassType)
	local waitingCoroutine = coroutine.running()
	local cn: SignalConnection
	cn = self:Connect(function(...: any?)
		cn:Disconnect()
		task.spawn(waitingCoroutine, ...)
	end)
	return coroutine.yield()
end

return Signal
