function RxBrioUtils.where(k)assert(type(k)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\101\100\105\099\097\116\101")return function(t)return Observable.new(function(i)local r=Maid.new()r:GiveTask(t:Subscribe(function(t)assert(Brio.isBrio(t),"\078\111\116 \097 \098\114\105\111")if t:IsDead()then return end if k(t:GetValue())then i:Fire(t)end end,i:GetFailComplete()))return r end)end end
--[=[
	Unpacks the brio, and then repacks it. Ignored items
	still invalidate the previous brio

	@since 3.6.0
	@param predicate (T) -> boolean
	@return (source: Observable<Brio<T>>) -> Observable<Brio<T>>
]=]
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
