function RxBrioUtils.where(N)assert(type(N)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\101\100\105\099\097\116\101")return function(k)return Observable.new(function(z)local L=Maid.new()L:GiveTask(k:Subscribe(function(k)assert(Brio.isBrio(k),"\078\111\116 \097 \098\114\105\111")if k:IsDead()then return end if N(k:GetValue())then z:Fire(k)end end,z:GetFailComplete()))return L end)end end

function RxBrioUtils.where(predicate)
	assert(type(predicate) == "function", "Bad predicate")
	return function(source)
		return Observable.new(function(sub)
			local maid = Maid.new()

			maid:GiveTask(source:Subscribe(function(brio)
				assert(Brio.isBrio(brio), "Not a brio")
				if brio:IsDead() then
					return
				end

				if predicate(brio:GetValue()) then
					sub:Fire(brio)
				end
			end, sub:GetFailComplete()))

			return maid
		end)
	end
end
