function ObservableSubscriptionTable.Observe(b,m,U)assert(m~=nil,"\066\097\100 \107\101\121")return Observable.new(function(F)if not b._subMap[m]then b._subMap[m]={F}else table.insert(b._subMap[m],F)end if U then U(F)end return function()if not b._subMap[m]then return end local U=b._subMap[m]local u=table.find(U,F)if not u then return end table.remove(U,u)if#U==0 then b._subMap[m]=nil end if F:IsPending()then task.spawn(function()F:Complete()end)end end end)end
--[=[
	Observes for the key
	@param key TKey
	@param retrieveInitialValue callback -- Optional
	@return Observable<TEmit>
]=]
function ObservableSubscriptionTable:Observe(key, retrieveInitialValue)
	assert(key ~= nil, "Bad key")

	return Observable.new(function(sub)
		if not self._subMap[key] then
			self._subMap[key] = { sub }
		else
			table.insert(self._subMap[key], sub)
		end

		if retrieveInitialValue then
			retrieveInitialValue(sub)
		end

		return function()
			if not self._subMap[key] then
				return
			end

			local current = self._subMap[key]
			local index = table.find(current, sub)
			if not index then
				return
			end

			table.remove(current, index)
			if #current == 0 then
				self._subMap[key] = nil
			end

			-- Complete the subscription
			if sub:IsPending() then
				task.spawn(function()
					sub:Complete()
				end)
			end
		end
	end)
end
