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

	@param parent Instance
	@param predicate ((value: Instance) -> boolean)? -- Optional filter
	@return Observable<Brio<Instance>>
]=]
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
