function RxInstanceUtils.observeDescendantsBrio(s,m)assert(typeof(s)=="\073\110\115\116\097\110\099\101","\066\097\100 \112\097\114\101\110\116")assert(type(m)=="\102\117\110\099\116\105\111\110"or m==nil,"\066\097\100 \112\114\101\100\105\099\097\116\101")return Observable.new(function(h)local f=Maid.new()local function S(s)if not m or m(s)then local m=Brio.new(s)f[s]=m h:Fire(m)end end f:GiveTask(s.DescendantAdded:Connect(S))f:GiveTask(s.DescendantRemoving:Connect(function(s)f[s]=nil end))for s,m in pairs(s:GetDescendants())do S(m)end return f end)end

function RxInstanceUtils.observeDescendantsBrio(parent, predicate)
	assert(typeof(parent) == "Instance", "Bad parent")
	assert(type(predicate) == "function" or predicate == nil, "Bad predicate")

	return Observable.new(function(sub)
		local maid = Maid.new()

		local function handleDescendant(descendant)
			if not predicate or predicate(descendant) then
				local value = Brio.new(descendant)
				maid[descendant] = value
				sub:Fire(value)
			end
		end

		maid:GiveTask(parent.DescendantAdded:Connect(handleDescendant))
		maid:GiveTask(parent.DescendantRemoving:Connect(function(descendant)
			maid[descendant] = nil
		end))

		for _, descendant in pairs(parent:GetDescendants()) do
			handleDescendant(descendant)
		end

		return maid
	end)
end

