function RxInstanceUtils.observeChildrenBrio(b,W)assert(typeof(b)=="\073\110\115\116\097\110\099\101","\066\097\100 \112\097\114\101\110\116")assert(type(W)=="\102\117\110\099\116\105\111\110"or W==nil,"\066\097\100 \112\114\101\100\105\099\097\116\101")return Observable.new(function(H)local O=Maid.new()local function z(b)if not W or W(b)then local W=Brio.new(b)O[b]=W H:Fire(W)end end O:GiveTask(b.ChildAdded:Connect(z))O:GiveTask(b.ChildRemoved:Connect(function(b)O[b]=nil end))for b,W in pairs(b:GetChildren())do z(W)end return O end)end

function RxInstanceUtils.observeChildrenBrio(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 handleChild(child)
			if not predicate or predicate(child) then
				local value = Brio.new(child)
				maid[child] = value
				sub:Fire(value)
			end
		end

		maid:GiveTask(parent.ChildAdded:Connect(handleChild))
		maid:GiveTask(parent.ChildRemoved:Connect(function(child)
			maid[child] = nil
		end))

		for _, child in pairs(parent:GetChildren()) do
			handleChild(child)
		end

		return maid
	end)
end
