function Rx.where(d)assert(type(d)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\101\100\105\099\097\116\101 \099\097\108\108\098\097\099\107")return function(l)assert(Observable.isObservable(l),"\066\097\100 \111\098\115\101\114\118\097\098\108\101")return Observable.new(function(R)return l:Subscribe(function(...)if d(...)then R:Fire(...)end end,R:GetFailComplete())end)end end

function Rx.where(predicate)
	assert(type(predicate) == "function", "Bad predicate callback")

	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			return source:Subscribe(
				function(...)
					if predicate(...) then
						sub:Fire(...)
					end
				end,
				sub:GetFailComplete()
			)
		end)
	end
end
