function ObservableSubscriptionTable.Fire(W,H,...)assert(H~=nil,"\066\097\100 \107\101\121")local A=W._subMap[H]if not A then return end for H,W in pairs(table.clone(A))do task.spawn(W.Fire,W,...)end end function ObservableSubscriptionTable.Complete(W,H,...)local A=W._subMap[H]if not A then return end local T=table.clone(A)W._subMap[H]=nil for H,W in pairs(T)do task.spawn(W.Complete,W,...)end end
--[=[
	Fires for the current key the given value
	@param key TKey
	@param ... TEmit
]=]
function ObservableSubscriptionTable:Fire(key, ...)
	assert(key ~= nil, "Bad key")

	local subs = self._subMap[key]
	if not subs then
		return
	end

	-- Make a copy so we don't have to worry about our last changing
	for _, sub in pairs(table.clone(subs)) do
		task.spawn(sub.Fire, sub, ...)
	end
end

function ObservableSubscriptionTable:Complete(key, ...)
	local subs = self._subMap[key]
	if not subs then
		return
	end

	local subsToComplete = table.clone(subs)
	self._subMap[key] = nil

	for _, sub in pairs(subsToComplete) do
		task.spawn(sub.Complete, sub, ...)
	end
end
